How to add any other post type into CubeWP form builder.
Include your Post Type in CubeWP Form Builder (eg: Product for WooCommerce)
apply_filters('cubewp/builder/post_types', $post_types, $form_type);
This filter contains default post type of wordpress “Post” all other cubewp generated post types are excluded from this filter.
You need to put this example code in your functions.php or any other core file. Don’t forget to change the post type name before adding code into your website.
Example code
add_filter('cubewp/builder/post_types', 'cubewp_add_post_type_in_builder', 9, 2);
function cubewp_add_post_type_in_builder($post_types = '', $form_type = '')
{
// $form_type contains type of cubewp form builder,
// search_filters is for search filters.
// search_fields is for search form.
// user_profile is for user profile form.
// user_register is for user registration form.
// post_type is for post type frontend submission form.
// single_layout is for single post template.
if ('search_filters' == $form_type) {
$post_types['products'] = 'Products';
}
return $post_types;
}