Custom Fields
Re-Envisioned
Support Meta Box Group sub group buttons array

  • Creator
    Topic
  • #24166
    Resolved Martin Rybos
    Participant

    Hi.
    I would like to make foreach for button group.

     array(
                            'name'   => 'Buttons',
                            'id'     => 'sub_group_btn',
                            'type'   => 'group',
                            'clone'  => true,
                            'fields' => array(
                                // Normal field (cloned)
                                array(
                                    'name'  => 'Button',
                                    'id'    => 'buttontext',
                                    'type'  => 'text',
                                    
                                ),
                            ),
                        
                         ),

    //my code is

    if ( ! empty( $disliders ) ) {
        foreach ( $disliders as $dislider ) {        
              
         
                echo "<h3 class='move'>".$dislider['mainh']."</h3>";
                echo "<h4 class='move'>".$dislider['subh']."</h4>";
                echo "<p class='move'>".$dislider['maintext']."</p>";
                echo "<button class='move'>";
                
    $array = $dislider['sub_group_btn'];
    foreach ($array as $value) {
      echo "$value<br>";
    }
    
    print_r($array);            
                echo "</div>";              
            
        }
    }

    foreach display only array at all buttons. How could i fix it ?

    myarray

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.