Outputting Multi Select Fields Labels in the Query.

Support General Outputting Multi Select Fields Labels in the Query.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #50027
    TomTom
    Participant

    ACF allows you to output in the query for the post both values and labels for select fields (including multi select).

    Can we get the same type of functionality in Meta Box?

    I am currently using Etch (https://etchwp.com/) for my builder and it doesn't support PHP calls so I can't just add in a function to return the label based on the value of the items selected.

    This seems backwards anyways. This information should be included as it is what in most cases would be displayed. In ACF (when enabled) you can just access it in the query by adding a .value to the custom field name.

    I am really hoping something like this can be added to Meta Box...

    If not is there some way I can manipulate the query directly via a code snippet (or some other setting/means/etc) and all the select fields I have in the query and get them to return the label for the post instead of the values.

    #50028
    PeterPeter
    Moderator

    Hello Tom,

    Thanks for reaching out.

    Using Meta Box, you can use the helper function rwmb_the_value() to show the field label. Please follow the documentation to get more details https://docs.metabox.io/fields/select/

    Let me know how it goes.

    #50029
    TomTom
    Participant

    Yes but as I said in the original post, I can't use PHP directly (it's not supported in Etch yet) so I can't wrap the value I retrieve from the query in the function and return the label. All I get is the json for the query which only includes the value and not the label.

    #50034
    PeterPeter
    Moderator

    Hello,

    I think you should contact Etch support and ask them if there is a filter/action hook that you can use to adjust the code and use the function rwmb_the_value in their query.

    Thanks.

    #50039
    TomTom
    Participant

    Yup I plan on that as well though, it makes more sense doing it from your end. This way support is built in for this feature for ALL page builders instead of each page builder having to implement some custom code.

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