Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6388223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:15:08+00:00 2026-05-25T03:15:08+00:00

Im porting a plugin for WordPress from a script, and Im finding it very

  • 0

Im porting a plugin for WordPress from a script, and Im finding it very difficult to update my settings through ajax, or add new options..

I want to use ajax since my original script uses ajax.

What is the best way to approach this?

I have already read through Ajax In Plugins and all of its resources..

Here is the main structure of the plugin

myplugin/js/custom.js <- This has all the ajax requests using jQuery-Ajax
myplugin/ajax/ <- in here are all the php files that recieve the settings to be updated.
myplugin/plugin.php <- This loads the javascript file.

The javascript is loaded using :

wp_register_script( 'custom_script', plugins_url('/js/custom.js', __FILE__) );
wp_enqueue_script( 'custom_script' );

Any help is greately appreciated..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:15:09+00:00Added an answer on May 25, 2026 at 3:15 am

    Ok it took me some time to realize how the whole thing works, but here is the deal:

    You use the following example code:

    Javascript
    $.ajax({
    type: “POST”,
    url: “admin-ajax.php”,
    data: {action: “DoMyAjaxStuff”}
    success: function(){ }
    });

    PHP

    add_action('wp_ajax_DoMyAjaxStuff', 'myajaxfunc');
    
    function myajaxfunc{
    //Do stuff here
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings! I'm currently porting a web browser plugin from Win32 to MacOSX. One of
While porting an application from SQL 2005 to SQL Server Compact Edition, I found
Im porting a project from php to java. The project is a web-app based
My WordPress plugin has a table with a AUTO_INCREMENT primary key field called ID.
I'm currently porting a project of mine from x86 to x64. It is a
I'm in the process of porting a large C++ application from Linux (gcc) to
I am responsible for a Windows application that loads up plugin script dll's written
When posting from the has_calendar plugin, there is a request for the TranslationData. I'm
While porting some code from Delphi 7 to Delphi 2010 I was rewriting my
I'm in the process of porting some code from Linux to Mac OS X.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.