You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeap! It is totally possible. Just set up the field to query for the product post type. You can inspect the example field setup just to make sure you're heading in the right direction.
e.g.
$prefix = '_myprefix';
...
$my_field->add_field( array(
'name' => esc_html_( 'Related Product', 'cmb2' ),
'desc' => esc_html_( 'Drag products from the left column to the right column to attach them to this post.', 'cmb2' ),
'id' => $prefix . 'product_attached_posts',
'type' => 'custom_attached_posts',
'options' => array(
'show_thumbnails' => true, // Show thumbnails on the left
'filter_boxes' => true, // Show a text box for filtering the results
'query_args' => array(
'posts_per_page' => 10,
'post_type' => 'product',
'product_category' => 'videos'
),
),
) );
...
Hi,
Is it possible to attach woocommerce products with a custom post type? If yes, can someone please tell me as I am new to CMB2. Thanks in advance.
The text was updated successfully, but these errors were encountered: