select_advanced search in custom fields of custom table?

Support MB Custom Table select_advanced search in custom fields of custom table?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #34060
    Paul de JongPaul de Jong
    Participant

    I have a CPT A with custom fields 'first_name' and 'last_name'. They are stored in a custom table.

    I have a different CPT B, also stored in a custom table, with a custom field that selects a post from CPT A via a select_advanced. CPT A has no title, so if I search in the select_advanced of CPT B I only get a result when I type 'Auto Draft'.

    I already added a rwmb_{field_id}_choice_label filter so it shows the correct labels, but I can't search in them.

    How can I change the select_advanced search box so I can search in 'first_name' and 'last_name'?

    #34075
    Long NguyenLong Nguyen
    Moderator

    Hi Paul,

    If you want to search the post by custom field value stored in the custom table, please follow this documentation https://docs.metabox.io/extensions/mb-custom-table/#query-posts-with-wp_query

    You might need to create AJAX to call a PHP function to process the field value and return the post.

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