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

  1. flynsarmy
    Posted 3 years 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.


  2. Ajay
    Plugin Author

    Posted 3 years 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
    Plugin Author

    Posted 2 years ago #

    I have included this in v1.8.10

  4. filination
    Posted 2 years 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.


  5. flynsarmy
    Posted 2 years ago #

    Ahh damn. Should be

    function echo_ald_crp( $args = array() ) {

    for backwards compatability

  6. Ajay
    Plugin Author

    Posted 2 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contextual Related Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.