$categories = get_categories_tree();
foreach (categories as $category) {
get_template_part('category-part', null, ['category' => $category]);
}
$category = $args['category'];
echo $category->name;
foreach ($category->children as $child_category) {
get_template_part('category-part', null, ['category' => $child_category]);
}
function get_shortcode_id_from_content($shortcode_name) {
$post = get_post();
$post_content = $post->post_content;
// регулярка для поиска id
$pattern = sprintf('/\[%s[^\]]*id\s*=\s*[\'"]?(\d+)[\'"]?\]/', preg_quote($shortcode_name, '/'));
// ищем id, указанный в шорткоде
if (preg_match($pattern, $post_content, $matches)) {
return $matches[1]; // если найден
}
return false;
}
$id_from_shortcode = get_shortcode_id_from_content($shortcode_name);
выглядит правильно address_information_0_addresses_metro_stations_0_metro_station - это ваш ключ для первого элемента повторителя
По вашей проблеме вот тут читать https://support.advancedcustomfields.com/forums/to...