Custom Fields
Re-Envisioned
Support MB Admin Columns MB Admin Columns with MB Relationships Reply To: MB Admin Columns with MB Relationships

#9033

cedriccouret
Participant

Hi,

thanks for your feedback. I’ve used this modified version of your second snippet and was able to filter my assembly steps by bunkie.


$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT to FROM $wpdb->mb_relationships WHERE from = %d AND type = 'bunkies_to_assembly_steps'", $bunkie_id ) );

But I’m facing inconsistency in the columns displayed, I’ll try to explain myself.

These are the columns I have when I list my assembly steps:
Title – Bunkie (which is empty)

Now when I select a bunkie name from the dropdown and apply the filter:
Title – Image (custom field created in metabox and displayed via ‘admin_columns’ => true)
Note that the “Bunkie” column disappeared.

When I use the “search” field and type a bunkie’s name, it shows me the associated assembly steps with the following columns:
Title – Bunkie (with proper content)
Note that the “image” column is absent.

I could show you screenshots but don’t know how to attach them here.

Thanks for your help.