Support Forum
Support › Meta Box Group › Warning: Illegal string offset 'id'
Hi,
we have update my meta box group to last version and now show this:
Warning: Illegal string offset 'id' in wp-content/plugins/meta-box-group/group-field.php on line 91
whenever I have the group boxes
how can i solve?
Tnk
Example code:
<div>
'fields' => array(
// Group
array(
'id' => "{$prefix}Cart",
// Group field
'type' => 'group',
// Clone whole group?
'clone' => true,
'sort_clone'=>true,
'max_clone' => 4,
'fields' => array(
array(
'name' => "Articolo",
'id' => "art_id",
'type' => 'post',
// Post type: string (for single post type) or array (for multiple post types)
'post_type' => array('post','glossario','focus'),
// Default selected value (post ID)
'std' => 1,
// Field type, either 'select' or 'select_advanced' (default)
'field_type' => 'select_advanced',
'desc' => 'Può essere: articolo, focus e glossario.' ,
// Placeholder
'placeholder' => __( 'Seleziona articolo', 'your-prefix' ),
'js_options' => array(
'width' => '95%',
),
// Query arguments (optional). No settings means get all published posts
// @see https://codex.wordpress.org/Class_Reference/WP_Query
'query_args' => array(
'post_status' => 'publish',
'posts_per_page' => - 1,
),
), ) )</div>
Hi Piero,
Please change the group ID to this one
'id' => $prefix . 'Cart',
or just cart
'id' => 'Cart',
and re-check the issue.
Nothing, always shows the warning
Hi,
I do not see any issue when running your code on my demo site. Please try to deactivate all plugins except Meta Box, MB extensions and switch to the standard theme of WordPress (Twenty) then re-check the issue.