WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Yet Another Related Posts Plugin] the_content filters with larger priorities are not being (7 posts)

  1. BlogTrafficExchange
    Member
    Posted 5 years ago #

    wp 2.5-2.7
    yarpp 2.6.1

    I am working on a plugin that should fire after yarpp. By setting the priority of the_content to 1201+...

    Doing so causes my filter not to be run...

    on a post where yarpp doesn't run (main index) everything works as desired.

    if I set the priority to something less than 1200 my output is int he post but before the related posts and I would like to be able to have it after...

  2. BlogTrafficExchange
    Member
    Posted 5 years ago #

    to see what I am talking about check out one of my blogs...

    The section I want after yarpp is the releated stores section....

    you can see the releated stores here: http://www.richcreditdebtloan.com/

    but you can see it is missing here: http://www.richcreditdebtloan.com/money-management-questions-and-answers/

  3. BlogTrafficExchange
    Member
    Posted 5 years ago #

    in general this bring up an interesting ordering question as well... smoe users might prefer to hand order the various automatic filters....

  4. @BlogTrafficExchange... Hmm... a couple things I can think of:

    1. It may be trying to run your filter first as part of keyword generation algorithm... in that case, try adding your filter function name to the YARPP filter blacklist (just search includes.php for blacklist).
    2. Alternatively, you can make sure YARPP runs where you want it to run by implementing YARPP as a template tag, putting <?php related_posts();?> in your template and turning off the automatically display option.

    Let me know how it goes--I'd love to make sure our plugins are compatible. If you'd like, feel free to email me a copy of your plugin so I can see what the matter is.

    mitcho

  5. BlogTrafficExchange
    Member
    Posted 5 years ago #

    sending you the plugin... I need my plugin to be compatible with yours...

  6. BlogTrafficExchange
    Member
    Posted 5 years ago #

    I am still working on a bunch of things to make my plugin better, but getting this working seems a tab bit fundamental to my longer terms plans…

    Seems like if you are breaking others too that there should be a better way than your current blacklist approach. you are too popular to break others so fundamentally?

    maybe I can still code around and I look forward to what you have to say...

  7. BlogTrafficExchange
    Member
    Posted 5 years ago #

    Actually I am not sure why you need my plugin... I wrote the following test plugin that show the behavior...

    <?php
    /*
    Plugin Name: YARPP_BUG
    Plugin URI: http://www.blogtrafficexchange.com/test
    Description: Changing filter priority to more than 1200 breaks his pluing with yarrp
    Version: 1.0
    Author: Blog Traffic Exchange
    Author URI: http://www.blogtrafficexcahnge.com/
    License: GPL
    */
    /* Copyright 2008-2009 Blog Traffic Exchange (email : kevin@blogtrafficexchange.com)
    */

    // Play nice to PHP 5 installations with REGISTER_LONG_ARRAYS off
    if(!isset($HTTP_POST_VARS) && isset($_POST))
    {
    $HTTP_POST_VARS = $_POST;
    }

    //change me to less than 1200 to see working
    add_filter('the_content', 'bte_rs_the_content', 99999);

    function bte_rs_the_content($content) {
    global $post;
    $postMod = get_post_modified_time();
    return $content."<p>Post modified: ".$postMod."</p>";
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic