Display Checkbox List in Custom Settings Group

Support MB Settings Page Display Checkbox List in Custom Settings GroupResolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #36290
    JoeJoe
    Participant

    I am really sorry to bother you guys again ...

    I also have a checkbox List that has an ID team_member_position

    This does not work :

    <?php $values = rwmb_meta( 'team_member_position' ); ?>
    <ul>
        <?php foreach ( $values as $value ) : ?>
            <li><?= $value ?></li>
        <?php endforeach ?>
    </ul>
    

    I have checked the docs, and basically none of the solution fits, because this is a list of multiple choices AND cloneable values, can you pls help me one more time.

    Question is also where do I put this new code, can I use two foreaches ?

    <?php $teams = rwmb_meta( 'team_group', ['object_type' => 'setting'], 'custom_settings' ); ?>
    <ul>
    <?php foreach ( $teams as $team ) : ?>
    	<li><?php echo $team['team_member_image'].' -> Name '.$team['team_member_name']; ?></li>
    <?php endforeach; ?>
    
    **** NEW CODE ****
    
    </ul>
    #36305
    Long NguyenLong Nguyen
    Moderator

    Hi,

    If the checkbox list is a field in a settings page, the code should be

    <?php $teams = rwmb_meta( 'team_group', ['object_type' => 'setting'], 'custom_settings' );
    $values = $teams['team_member_position']; ?>
    <ul>
        <?php foreach ( $values as $value ) : ?>
            <li><?= $value ?></li>
        <?php endforeach ?>
    </ul>
    #36319
    JoeJoe
    Participant

    Excellent, thank you very much

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