the answer for all question about Oxygen Builder plugin and WordPress

Meta Box cloneable field with Oxygen 3.9 repeater:


Meta Box cloneable field with Oxygen 3.9 repeater:
How can I return the correct “single image” URL for each repeater instance?

Got it to work with the following function, but it will always only show the 1st image of the group, so every instance in the repeater shows the same (i.e. wrong) image.

function get_iconbox_1_icons() {
$group_values = rwmb_meta( ‘iconbox_1_element’ );
if ( ! empty( $group_values ) ) {
foreach ( $group_values as $group_value ) {
$logo = isset( $group_value[‘iconbox_1_icon’] ) ? $group_value[‘iconbox_1_icon’] : ”;
$logo = RWMB_Image_Field::file_info( $logo );
return $logo ? $logo[‘url’] : ‘/wp-content/uploads/2021/09/favicon-3.png’; //placeholder
}}}



Source

Leave A Reply

Your email address will not be published.

Oxyrealm Docs