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

How can I enqueue a style only when a particular widget is active?

You need to modify this a little bit. class Organiser extends WP_Widget { … function __construct() { add_action( ‘wp_enqueue_scripts’, array(‘Organiser’, ‘register_plugin_styles’) ); … } public function widget( $args, $instance ) { wp_enqueue_style( ‘organiserStyle’ ); include(dirname(__FILE__).”/organiserWidget.php”); } static function register_plugin_styles() { wp_register_style( ‘organiserStyle’, plugins_url( ‘organiser/css/organiserStyle.css’ ) ); // wp_register_style( ‘organiserStyle’, plugin_dir_url( __FILE__ ) . ‘css/organiserStyle.css’ ); … Read more

Is there a way to expose additional fields to the Bulk Action > Edit functionality?

A quick google search yielded these results for me: https://premium.wpmudev.org/blog/wordpresss-bulk-edit/ https://wordpress.org/plugins/custom-bulkquick-edit/ https://wordpress.org/plugins/tags/bulk-edit/ I am sure there is a way, but I do not think that there is a WP API for that (like options API or transients API, etc…). Maybe you can see what these free plugins are doing and how. Edit: I found the … Read more