• Resolved zenonz

    (@zenonz)


    Hi,

    remove_action( ‘rtcl_listing_loop_item’, ‘loop_item_listing_title’, 20 );
    remove_filter( ‘rtcl_listing_loop_item’, ‘loop_item_listing_title’, 20 );

    I can’t remove the default title.
    But I add my own normally…

    How to solve it?
    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Ali Akbar Reyad

    (@alireyad)

    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 ??

    Plugin Support Ali Akbar Reyad

    (@alireyad)

    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 );
    
    Plugin Support Ali Akbar Reyad

    (@alireyad)

    No worries, we just binded it with init hook. Actually it will work during ad query.

    Thank you

    Thread Starter zenonz

    (@zenonz)

    OK, thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove hook not working’ is closed to new replies.