Skip to content

Instantly share code, notes, and snippets.

@marushu
Last active April 21, 2016 03:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marushu/9cc4bc92ddd96262985a8bced97d0ca9 to your computer and use it in GitHub Desktop.
Save marushu/9cc4bc92ddd96262985a8bced97d0ca9 to your computer and use it in GitHub Desktop.
ACFのリピーターフィールドを取り出す。forで回して一発で出てくるので便利 :D
<?php
$post_id = 19409;
$child_field_count = intval( get_post_meta($post_id, 'supportcase_', true) );
var_dump($child_field_count);
for ( $i=0; $i < $child_field_count; $i++ ){
$case = get_post_meta($post_id, sprintf('supportcase__%d__case', $i), true);
var_dump($case);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment