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
at Function.fa.error (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-tooltip&ver=4.9.5:2)
at fa.tokenize (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-tooltip&ver=4.9.5:2)
at fa.select (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-tooltip&ver=4.9.5:2)
at Function.fa (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-tooltip&ver=4.9.5:2)
at Function.a.find (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-tooltip&ver=4.9.5:9)
at n.fn.init.find (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-tooltip&ver=4.9.5:2)
at n.fn.init.a.fn.find (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-tooltip&ver=4.9.5:9)
at a.fn.init.n.fn.init (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-tooltip&ver=4.9.5:2)
at new a.fn.init (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-tooltip&ver=4.9.5:9)
at n (load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-tooltip&ver=4.9.5:2)
The value not getting saved. Maybe its because of the generated input name (input[name=prefixdemo[0][prefixasfd]])?
My code is:
add_action( 'cmb2_admin_init', 'yourprefix_register_repeatable_group_field_metabox' );
/** * Hook in and add a metabox to demonstrate repeatable grouped fields */functionyourprefix_register_repeatable_group_field_metabox() {
$prefix = 'prefix';
/** * Repeatable Field Groups */$cmb_group = new_cmb2_box( array(
'id' => $prefix . 'metabox',
'title' => esc_html__( 'Recommendation Products (4)', 'cmb2' ),
'object_types' => array( 'landingpage' ),
) );
// $group_field_id is the field id string, so in this case: $prefix . 'demo'$group_field_id = $cmb_group->add_field( array(
'id' => $prefix . 'demo',
'type' => 'group',
'description' => esc_html__( 'Generates reusable form entries', 'cmb2' ),
'options' => array(
'group_title' => esc_html__( 'Product {#}', 'cmb2' ), // {#} gets replaced by row number'add_button' => esc_html__( 'Add Another Product', 'cmb2' ),
'remove_button' => esc_html__( 'Remove Product', 'cmb2' ),
'sortable' => true,
// 'closed' => true, // true to have the groups closed by default
),
) );
/** * Group fields works the same, except ids only need * to be unique to the group. Prefix is not needed. * * The parent field's id needs to be passed as the first argument. */$cmb_group->add_group_field( $group_field_id, array(
'name' => __( 'Product', 'cmb2' ),
'desc' => __( 'Field description (optional)', 'cmb2' ),
'id' => $prefix . 'asfd',
'type' => 'post_ajax_search',
'query_args' => array(
'post_type' => array( 'product' ),
'post_status' => array( 'publish' ),
'posts_per_page' => -1
)
) );
$cmb_group->add_group_field( $group_field_id, array(
'name' => esc_html__( 'Description', 'cmb2' ),
'description' => esc_html__( 'Write a short description for this entry', 'cmb2' ),
'id' => 'description',
'type' => 'textarea_small',
) );
$cmb_group->add_group_field( $group_field_id, array(
'name' => esc_html__( 'Entry Image', 'cmb2' ),
'id' => 'image',
'type' => 'file',
) );
}
The text was updated successfully, but these errors were encountered:
Hi,
first of all thanks for the plugin.
I tried to use it within a "group" field. After selecting a value over the ajax search dropdown, Im getting this JS error message:
load-scripts.php?c=0&load[]=jquery-core,jquery-migrate,utils,jquery-ui-core,jquery-ui-widget,jquery-ui-mouse,jquery-ui-sortable,jquery-ui-position,jquery-ui&load[]=-tooltip&ver=4.9.5:2 Uncaught Error: Syntax error, unrecognized expression: input[name=prefixdemo[0][prefixasfd]]
The value not getting saved. Maybe its because of the generated input name (input[name=prefixdemo[0][prefixasfd]])?
My code is:
The text was updated successfully, but these errors were encountered: