Hi,
You can try it with binding in init hook.
add_action('init', function() {
// add/remove here
}, 99);
Thank you
Thread Starter
zenonz
(@zenonz)
add_action('init', function() {
remove_action( 'rtcl_listing_loop_item', 'loop_item_listing_title', 20 );
remove_filter( 'rtcl_listing_loop_item', 'loop_item_listing_title', 20 );
}, 99);
function rtcl_del() {
remove_action( 'rtcl_listing_loop_item', 'loop_item_listing_title', 20 );
remove_filter( 'rtcl_listing_loop_item', 'loop_item_listing_title', 20 );
}
add_action( 'init', 'rtcl_del' );
Not working 🙁
Hi,
You are adding in wrong way. Add below code in child theme functions.php file –
add_action('init', function() {
remove_action( 'rtcl_listing_loop_item', [\Rtcl\Controllers\Hooks\TemplateHooks::class, 'loop_item_listing_title' ], 20 );
}, 99);
Thank you
Thread Starter
zenonz
(@zenonz)
Thanks, it works!
I’m not a programmer, but is it good that when initializing WordPress it has to deal with the title of the ad?
add_action('init', function() {
remove_action( 'rtcl_listing_loop_item', [\Rtcl\Controllers\Hooks\TemplateHooks::class, 'loop_item_listing_title' ], 20 );
}, 99);
function my_custom_title() {
echo 'my custom code';
}
add_filter( 'rtcl_listing_loop_item', 'my_custom_title', 20 );
No worries, we just binded it with init hook. Actually it will work during ad query.
Thank you