Use latest jQuery in WordPress (admin interface)

Starting with version 3.6 WordPress actively discourages from deregistering “critical” scripts in admin at all. For posed scope (loading newer jQuery in specific part of admin) it would make more sense to load custom copy of jQuery normally and use noConflict() on it right away to isolate it in own variable to be used in … Read more

Remove action from a plugin class

I did it using this function remove_filters_with_method_name( ‘woocommerce_after_order_notes’, ‘checkout_consent_checkbox’, 10 ); function remove_filters_with_method_name( $hook_name=””, $method_name=””, $priority = 0 ) { global $wp_filter; // Take only filters on right hook name and priority if ( ! isset( $wp_filter[ $hook_name ][ $priority ] ) || ! is_array( $wp_filter[ $hook_name ][ $priority ] ) ) { return false; … Read more

How to pass arguments to add_action() [duplicate]

The parameter needs to be passed to the callback function in the wp_schedule_single_event function, not the add_action function. Try this: add_action(‘z_purge_products_cache’, array($this, ‘purge_products_cache’)); Then schedule the event, putting the parameter in an array: wp_schedule_single_event(time() + 20, ‘z_purge_products_cache’, array($asins_r)); Your purge_products_cache function will be called with parameter $asins_r.

Custom bulk actions in WP 3.7.1

You’re seeing $action empty because there is a redirect from wp-admin/edit.php. So, the output you are seeing is after the redirect. Use, die() after echo $action to see the output before the redirect.

What’s the usage of action do_meta_boxes?

As explained here: [The] do_meta_boxes [action] is designed to let people manipulate the registered meta boxes once they are registered but before they are rendered. So the do_meta_boxes hook is not for doing (that is: displaying) the meta boxes. This is because: When the do_meta_boxes actions was moved out of do_meta_boxes() it should have had … Read more