• Resolved bitobeats

    (@vitorrloureiro)


    Hey!

    First of all, thank you for this plugin! It’s super helpful.

    I’m currently at version 5.5.4.1 and the plugin works great.

    But because it’s an old version and I need the security fixes, I’m trying to update it.

    However, after updating to any version from 5.6 onwards I can’t make the meta_relation of the shortcode work.

    For instance, here’s my shortcode:

    [ajax_load_more
    post_type="post"
    posts_per_page="'.$post_quantity.'"
    post__not_in="'.implode(",", $displayed_posts).'"
    scroll="false"
    button_label="Load more"
    meta_key="hide_in_home:hide_in_home"
    meta_value=":0"
    meta_compare="NOT EXISTS:="
    meta_type="CHAR:BINARY"
    meta_relation="OR"]

    In 5.5.4.1 it works great: It gets posts that either don’t have the hide_in_home custom field or that have it set to false. Updating to any other version makes it only check the second rule, ignoring the first one.

    From my understanding, the meta_relation="OR" should make it check for both rules.

    Am I missing something? Is this a regression? Any suggestions on a workaround?

    Thank you very much

    • This topic was modified 2 weeks ago by bitobeats.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi @vitorrloureiro
    Thanks for the kind words!

    I don’t believe there are any regressions but I could be wrong.
    If this is a fixed query, you could try writing this meta query using the alm_query_args hook. This might make it easier to debug the query.
    https://connekthq.com/plugins/ajax-load-more/docs/filter-hooks/#alm_query_args

    Code -> https://codeshare.io/ezLNyL

    Don’t forget to give your ALM instance an ID if you go this route.

    Thread Starter bitobeats

    (@vitorrloureiro)

    Thank you a lot for the quick response!

    I tried using alm_query_args and indeed it works fine now. Thank you! My problem is solved.

    Just so you are aware: this is possibly a regression in the shortcode logic. I’d give it a look but to be honest php is not a language I’m very familiar with, specially in the context of wordpress plugins =/

    Anyway, if you want some help with testing, lemme know =)

    Plugin Author Darren Cooney

    (@dcooney)

    Awesome, thanks for following up!

    Likely an issue with the empty meta_value.
    I’ll add this my list to investigate.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.