remove_action in a theme

Your remove_action has to have a priority matching the priority used in add_action. Important: To remove a hook, the $function_to_remove and $priority arguments must match when the hook was added. This goes for both filters and actions. No warning will be given on removal failure. http://codex.wordpress.org/Function_Reference/remove_action In you case, it looks like remove_action(‘wp_head’, ‘theme_metas’); should … Read more

wp_list_tables bulk actions

If you add a bulk-action, then you have to react on this action. Simply adding a function doesn’t do anything, you have to call it: class WPSE_List_Table extends WP_List_Table { public function __construct() { parent::__construct( array( ‘singular’ => ‘singular_form’, ‘plural’ => ‘plural_form’, ‘ajax’ => false ) ); } public function prepare_items() { $columns = $this->get_columns(); … Read more

When is admin_init Action ran?

From the Codex: admin_init is triggered before any other hook when a user access the admin area. This hook doesn’t provide any parameters, so it can only be used to callback a specified function. So yes, it’s run on every admin page load.

Perform an action when post is updated/published

The save_post action fires When a post is updated and/or published — including when a new post is inserted. <?php add_action( ‘save_post’, ‘wpse41912_save_post’ ); function wpse41912_save_post() { // do stuff } If you want your functions to fire only when a post is being edited, you can hook into edit_post. If you want it to … Read more

How to use the do_action () with parameter

The correct way is to pass first argument as a unique string which acts as an identifier for the action & any additional arguments after that do_action(‘unique_action_tag’, $parameter1, $parameter2,,,, & so on); To attach functions to this action you’ll do // 10 is the priority, higher means executed first // 2 is number of arguments … Read more