8000 GitHub - jessepollak/wordpress-ajax-settings: :computer: Ajaxify the settings for your WordPress plugin — in two lines of code
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

jessepollak/wordpress-ajax-settings

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ajax Settings

This library allows you to make your plugin's settings page work entirely over AJAX if you use the WordPress Settings API and follow standard protocols.

Installation

  1. Download the dist, rename it 'ajax-settings', and place it in your project tree.
  2. Include the ajax-settings.php file and initialize appropriately
add_action('admin_init', 'initialize_ajax_settings');
function initialize_ajax_settings() {
  require_once(PATH_TO_ajax_settings.php);
  new AjaxSettings(array(
    "options_name" => YOUR_SETTINGS_API_OPTION_NAME,
    "base_url" => URL_TO_THE_ajax-settings_FOLDER
  ));
}

Constructor options

  • options_name (string) - the name of your Settings API option name
  • base_url (string) - the URL to the base folder for this library. TODO: make this unecessary (tweet at me if you know how)
  • initialize (boolean) - whether you want the client side javascript that handles the settings page to be initialized. Set this to false if you want to inherit from these objects and add in additional functionality.

Development

$ git clone git@github.com:jessepollak/wordpress-ajax-settings.git
$ cd ajax-settings
$ npm install
$ grunt && grunt watch

About

💻 Ajaxify the settings for your WordPress plugin — in two lines of code

Resources

Stars

Watchers

Forks

Packages

No packages published
0