Advertisement
arsh999cg

Oxygen Code-block for subfield from cloneable group inside setting page

Dec 25th, 2022 (edited)
1,416
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2.  
  3. // the cloneable group field id is 'levering_product_pagina',   and the option name in the setting page is 'my_option'
  4.  
  5. $group_values = rwmb_meta( 'levering_product_pagina', ['object_type' => 'setting'], 'my_option' );
  6.  
  7. if ( ! empty( $group_values ) ) {
  8.  
  9.     foreach ( $group_values as $group_value ) {
  10.  
  11.         // inside the group, we are having two fields first 'title_levering' an heading, and second 'omschrijving_levering' a paragraph
  12.  
  13.         echo '<h3 class="ar-title">'.$group_value['titel_levering'].'</h3>';
  14.         echo '<p class="ar-content">'.$group_value['omschrijving_levering'].'</p>';
  15.     }
  16. }
  17.  
  18. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement