Linked Questions

2
votes
1answer
281 views

How to remove_action inside class [duplicate]

i have class like this if ( ! class_exists( 'My_class' ) ) { class My_class { public function __construct() { add_action( 'woocommerce_shop_loop_item_title', array( $this, '...
0
votes
1answer
2k views

remove_action not working, even after changing priority [duplicate]

So one of the functions in my theme is: public function job_manager_job_filters_distance() { //Show some HTML } And somewhere else in the document lies: add_action( '...
61
votes
3answers
9k views

How to remove a filter that is an anonymous object?

In my functions.php file I would like to remove the below filter, but I'm not sure how to do it since it's in a class. What should remove_filter() look like? add_filter('comments_array',array( &$...
9
votes
9answers
5k views

Remove an action from an external Class

I'm trying to do something similar to this question here: remove_action or remove_filter with external classes? I'm trying to remove the <!-- This site is optimized with the Yoast WordPress ...
3
votes
2answers
4k views

How to remove WPML Generator Meta Tag by theme's functions.php (override plugin function)? [closed]

I've tried hard to find a way to not let plugin WPML output the following <meta name="generator" content="WPML ver:2.8.1 stt:3,1;0" /> tag in <head> via help of theme's function.php: It's ...
0
votes
1answer
3k views

Remove_action from plugin with a Class

I've searched around but haven't been able to find a solution to this. I'm trying to hook in and remove an action that was initiated by a plugin (specifically the Groups plugin). The function itself ...
1
vote
1answer
2k views

Overwrite or Replace code in WP_Footer

I have a some code being dynamically added into my Footer via add_action('wp_footer' ...). Unfortunately I'm not sure how to remove it using conventional methods, I've looked at the following question ...
6
votes
2answers
1k views

Why did multiple line breaks stop working in text editor?

# Adds ability to add break tags on posts remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' ); add_filter( 'the_content', 'nl2br' ); add_filter( 'the_excerpt', 'nl2br'...
2
votes
1answer
232 views

Remove action from woocommerce barcode plugin [closed]

i'm trying to make some changes to the woocommerce barcode plugin. I want to remove this action from the plugin class-woocommerce-order-barcodes.php: class WooCommerce_Order_Barcodes { ... public ...
6
votes
1answer
130 views

Global Objects and Public Methods

I'm developing a plugin and am just thinking over best practices. How common is it to have a global object? Currently on plugins_loaded I am creating a global object of my class: add_action( '...
0
votes
2answers
55 views

Remove an action by extending class and replacing it

I'm trying to override a method (my_packages) from the WP Job Manager Paid Listings plugin by extending it's class from within a custom plugin Here is how the source code (none-related code removed) ...
1
vote
2answers
31 views

How to remove filter added by another plugin in a class

Ok I'm struggling here - I feel this should be straightforward but I'm just not able to get it to work. I need to remove a filter added by Woocommerce Subscriptions. The filter is part of the ...
0
votes
0answers
45 views

Remove action added in plugin class from theme

I am trying to remove action that is added via plugin in my theme. The below plugin class creates a portfolio page template but I don't want this page template in my theme. Is there any way to unhook ...
0
votes
0answers
40 views

Remove action hook from Class, understanding OOP

I am trying to remove an action that is within a class, of the parent theme. I made an example of the code I have, below. I am trying to remove the action in the child theme functions.php. I've tried ...