• I am using MB Relationships. With this extension, I would like to customize the search criteria of the search field that appears for relationships. Specifically, I am working with a custom post type called “Production Achievements” and a custom field named “Achievement ID.”

    Here’s how I have set it up:

    add_action( 'mb_relationships_init', function() {
        MB_Relationships_API::register( array(
            'id'   => 'posts_to_productions',
            'from' => array(
                'object_type' => 'post',
                'post_type'   => 'post',
            ),
            'to' => array(
                'object_type' => 'post',
                'post_type'   => 'production', // Custom post type for Production Achievements
            ),
        ) );
    } );

    Currently, I want to change the search criteria of this search field to search by “Achievement ID.” For example, there are three posts in “Production Achievements,” each with the following titles and “Achievement IDs”:

    • Website: Id_a
    • Application: Id_b
    • Marketing: Id_c

    I want to make it so that by entering the “Achievement ID” in the search field, the corresponding title is displayed. For example, entering Id_b will display “Application.”

    How can I achieve this functionality? Your assistance would be greatly appreciated.

    Best regards,

  • The topic ‘Customizing Search Criteria in MB Relationships’ Search Field’ is closed to new replies.