Metabox PHP Group output is not correct

Support MB Group Metabox PHP Group output is not correct

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #47559
    JoeJoe
    Participant

    Hi there,

    I have a problem with the PHP output in a settings page, using a group and 2 text fields:

    I have just one group, with 2 text fields, the code I am getting is this :

    <?php
    $groups = rwmb_meta( 'vita_group', [ 'object_type' => 'setting' ], 'test-setting' );
    foreach ( $groups as $group ) {
    	
    	// Field vita_group_year:
    	echo $group[ 'vita_group_text' ] ?? '';
    	
    	// Field vita_group_content:
    	<?php $values = $group[ 'vita_group_content' ] ?? [];
    	<?php foreach ( $values as $value ) : ?>
    		<div class="my-content"><?php echo $value ?></div>
    	<?php endforeach ?>
    
    }
    ?>

    which is wrong, the code should be

    <?php
    $groups = rwmb_meta( 'vita_group', [ 'object_type' => 'setting' ], 'test-setting' );
    foreach ( $groups as $group ) {
    	
    	// Field vita_group_year:
    	echo $group[ 'vita_group_text' ] ?? '';
    	
    	// Field vita_group_content:
    	echo $group[ 'vita_group_content' ] ?? '';
    
    }
    ?>
    #47580
    PeterPeter
    Moderator

    Hello Joe,

    Can you please check if the second text field vita_group_content is enabled cloneable option? If yes, that is an expected result.
    I also try to reproduce that issue on my end and don't see that, here is the screenshot https://imgur.com/rW95I2N

    #47602
    JoeJoe
    Participant

    Hi Peter,
    thank you for looking into this, as I can tell from the screenshot you are using two text fields,

    the problem occurs with textareas and WYSIWYG fields (i have not tried other fields yet)

    #47607
    PeterPeter
    Moderator

    Hello,

    I can reproduce the issue on my end. I'm going to escalate the issue to the development team to fix it in the Theme Code section for those fields.

    Thank you.

    #47608
    SolaceSolace
    Participant

    Thanks Joe & Peter!

    #47609
    JoeJoe
    Participant

    You are the best Peter 🙂

    #47670
    JoeJoe
    Participant

    Quick question - what's the status on this little bug ?

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