Unhooking Actions Hooked Inside PHP Classes With remove_action

[ad_1]

Here is an example. The following snippet removes the action hooked from the SumoMe plugin – https://wordpress.org/plugins/sumome/

/**
 * Dequeue SumoMe inline script
 *
 * @author Arun Basil Lal
 */
function rocket_helper_dequeue_sumo_me_js() {
  
  global $wp_plugin_sumome;
  remove_action('admin_footer', array( $wp_plugin_sumome, 'append_admin_script_code' ) );
}
add_action( 'admin_head', 'rocket_helper_dequeue_sumo_me_js' );

$wp_plugin_sumome is the instance of the class already instantiated.

Related discussion: https://wordpress.stackexchange.com/a/36110/90061

[ad_2]

Leave a Reply

Random Post Selection ::

Recent Posts

Unlock Unlimited Downloads