WordPress.org

Ready to get started?Download WordPress

Forums

Contextual Related Posts
[resolved] [PATCH] Better handling of echo_ald_crp (6 posts)

  1. flynsarmy
    Member
    Posted 10 months ago #

    You recently updated echo_ald_crp to add a $cache = 0 argument. This wasn't the best move as ald_crp (which echo_ald_crp calls) accepts an array containing a variety of options. You're limiting yourself unnecessarily. You should use the following instead:

    function echo_ald_crp( $args ) {
    	echo ald_crp( $args );
    }

    For reference what you currently have is:

    function echo_ald_crp($cache = 0) {
    	echo ald_crp('is_widget=0&cache='.$cache);
    }

    is_widget already defaults to 0 in the ald_crp() method and cache defaults to 0 in crp_default_options().

    Another benefit of this approach is that it will ALWAYS obey the user's settings in admin. The version you have not only limits what you can do with echo_ald_crp, it actively ignores a users preferences.

    http://wordpress.org/plugins/contextual-related-posts/

  2. Ajay
    Member
    Plugin Author

    Posted 10 months ago #

    Thanks for this. I'll incorporate the method you mention above. I agree it makes sense to keep echo_ald_crp completely flexible.

  3. Ajay
    Member
    Plugin Author

    Posted 8 months ago #

    I have included this in v1.8.10

  4. filination
    Member
    Posted 8 months ago #

    Not good.

    This change caused the following error : Missing argument 1 for echo_ald_crp()

    for some of the posts.
    Reverting it to the old code fixed the problem.

    Look into it.

    Fili

  5. flynsarmy
    Member
    Posted 8 months ago #

    Ahh damn. Should be

    function echo_ald_crp( $args = array() ) {

    for backwards compatability

  6. Ajay
    Member
    Plugin Author

    Posted 8 months ago #

    I've pushed through a new update with the updated patch above.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.