• Resolved SeVlad

    (@sevlad)


    When I create a metabox

    'fields' => array(
    	array(
    	'id' => 'related_products',
    	'type' => 'post',
    	'name' => 'Related product',
    	'post_type' => 'product',
    	'field_type' => 'select_advanced',
    	'multiple' => true,
    	'select_all_none' => true,
    ),
    

    and display the result

    $values = rwmb_meta( 'related_products');
    echo $values; 
    

    then I get the ID of only the first post, not the array.

    Accordingly, the code:

    $values = rwmb_meta( $field_id );
    foreach ( $values as $value ) {
        echo $value;
    }

    produces an error:
    Warning: Invalid argument supplied for foreach() in

    Is this a bug in the plugin or am I doing it wrong?

    if i do clone instead of multiple :

    'field_type' => 'select_advanced',
    'clone' => 1,
    'sort_clone' => 1,
    

    then everything is fine, I get an array.

    PS. Sorry for my english.

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Select Advanced multiple does not return an array’ is closed to new replies.