Advertisement
michaelyuen

Untitled

Sep 4th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <?php
  2.  
  3. /* check link for reference:
  4. /* https://www.advancedcustomfields.com/resources/get_sub_field/ */
  5.  
  6. $array = array();
  7.    
  8. if( have_rows('parent_field') ):
  9.  
  10.     while( have_rows('parent_field') ) : the_row();
  11.        
  12.         $value = get_sub_field('sub_field');
  13.                 $array = array_merge($array, $value);
  14.  
  15.     endwhile;
  16.  
  17. endif;
  18.  
  19. var_dump($array)
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement