• Resolved Sven Lehnert

    (@svenl77)


    I use the Kodex Posts likes plugin. The plugin uses the meta_key kodex_post_likes_count
    
    The query I try is something like 
    
    'meta_key'  => 'kodex_post_likes_count',
    'orderby'   => 'meta_value_num',
    'order'     => 'DESC'
    
    But in the block settings of AQL I get the following message.
    
    Post Meta Query
    This post type has no registered post meta to query
    
    I defenetly have votings stored under the post meta meta_value_num
    
    Hope you can help me with this
    

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ryan Welcher

    (@welcher)

    @svenl77 thanks for taking the time to open this thread, I really appreciate it.

    I installed a copy of the Kodex Posts likes plugin and was able to reproduce the issue. The TL: DR; is that the plugin doesn’t expose the post meta it registers to the REST API. This means that when AQL queries for post meta, via the REST API, it can’t find it and that’s why you see the message.

    I would recommend reaching out to the plugin author and asking them to register the post meta using the register_post_meta function making sure to set show_in_rest to true.

    In the meantime, this has me thinking that perhaps I need to add the ability to manually enter the post meta key and perhaps even remove the check altogether as there will be other plugins that do this as well.

    Thanks so much for finding this issue and letting me know!

    Plugin Author Ryan Welcher

    (@welcher)

    @svenl77 I’ve just released 1.1.0 of the plugin that will allow you to select from meta that the REST API is aware of or manually enter the name.

    This will allow you to query the post meta you’re looking for. Please let me know if you have any other issues!

    Thread Starter Sven Lehnert

    (@svenl77)

    Hay, this is great news, thanks for the update!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘meta query not working’ is closed to new replies.