The Geek Ramblings

Blog by Aravind Pedapudi

May 23rd, 2013

Wordpress Plugin Development

$wpdb global object interfaces with the database

register_activation_hook('file', 'function') -- hook to run on plugin activation

dbDelta($sql) -- utility function in wp-admin/includes/upgrade.php -- examines table structure and modifies it as necessary

Adding administrative menu:

Settings API - processes the form semi automatically.

To trigger custom  action when button is pressed: Create a form with action - admin_url('admin-post.php'), and hidden field called action set to value 'something-you-want', and add_action('something-you-want', 'function-you-want-to-call') - Detailed Explanation