Viewing 6 replies - 1 through 6 (of 6 total)
  • Been looking for the same thing 🙂
    Found it!!!

    in: /wp-content/plugins/related-posts-for-wp/classes/filters/class-filter.php – you need to outcomment line 22:

    public function __construct() {
    //$this->register(); HER SÆTTER MAN OM DEN
    }

    Thread Starter Ryan Hellyer

    (@ryanhellyer)

    Yep, that works. But I want to remove the filter via my own code, not by modifying the plugins own files.

    Plugin Author Barry Kooij

    (@barrykooij)

    At the moment there isn’t, I’ll add it to the next version!

    I don’t recommend commenting out the register method because this will disable all filters plus this change will be lost when you update the plugin.

    I’ll let this topic open and will let you know when I’ve added it.

    GitHub issue: https://github.com/barrykooij/related-posts-for-wp/issues/32

    Plugin Author Barry Kooij

    (@barrykooij)

    From next version you can use:

    add_filter( ‘rp4wp_append_content’, ‘__return_false’ );

    Plugin Author Barry Kooij

    (@barrykooij)

    Also, if you want to remove any hook or filter in RP4WP, from next version on you can use:

    $filter_instance = RP4WP_Manager_Filter::get_filter_instance( 'RP4WP_Filter_After_Post' );
    remove_filter( 'the_content', array( $filter_instance, 'run' ), $filter_instance->get_priority() );

    Where ‘RP4WP_Filter_After_Post’ is the class name of the filter you want to remove.

    To remove hooks use RP4WP_Manager_Hook.

    Plugin Author Barry Kooij

    (@barrykooij)

    Small typo in my above comment but I can’t edit it anymore.

    Correct code is:

    $filter_instance = RP4WP_Manager_Filter::get_filter_object( 'RP4WP_Filter_After_Post' );
    remove_filter( 'the_content', array( $filter_instance, 'run' ), $filter_instance->get_priority() );

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Removing the_content filter’ is closed to new replies.