Forum Replies Created
-
AuthorPosts
-
Joe
ParticipantAny news on fixing this bug ?
Joe
ParticipantCount me in
Joe
ParticipantQuick question - what's the status on this little bug ?
Joe
ParticipantYou are the best Peter ๐
Joe
ParticipantHi Peter,
this has nothing to do with oxygen, I actually opened a conversation about this as well :https://support.metabox.io/topic/metabox-php-group-output-is-not-correct/
Joe
ParticipantHi 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)
Joe
ParticipantYes I can confirm this as well, actually I just wanted to write about this too.
Did you look at the code , that Metabox is giving you ?
When you scroll down the settings page , there is PHP Code,
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' ] ?? ''; } ?>Maybe that messes up the Oxygen output ?
Joe
ParticipantThanks Peter, can this be done via the grahical interface ?
Joe
ParticipantHello any news on this ?
Joe
Participantany news on this ?
Joe
ParticipantJust read your comment , and yes it did the trick, thank you very much
Joe
ParticipantHas there been any movement on this ?
Joe
Participantany news on this ?
Joe
ParticipantExcellent, thank you very much,
can you extend the code for the sku, regular price and discounted price ?Joe
ParticipantFound the solution, so just in case somebody needs the same
<?php // Get all users with the 'author' role $author_users = get_users( array( 'role' => 'author' ) ); // Classes to be randomized $classes = ['avatar--m', 'avatar--l', 'avatar--xl', 'avatar--xxl']; // Randomize the order of authors shuffle($author_users); // Display up to 7 authors $count = 0; foreach ($author_users as $author) { // Displaying uploaded image $image = rwmb_meta('custom_avatar', ['object_type' => 'user', 'size' => 'thumbnail'], $author->ID); // Check if the user has a custom avatar image if (!empty($image)) { $random_class = $classes[array_rand($classes)]; echo '<img src="' . $image['url'] . '" class="' . $random_class . '">'; $count++; } if ($count >= 7) { break; // Stop after displaying 7 authors } } ?> -
AuthorPosts