У меня небольшая проблема. Я написал простую функцию шорткода для отображения моего значения acf в сетке визуального компоновщика сетки, это мой простой пользовательский шорткод
function my_module_add_grid_shortcodes( $shortcodes ) {
$shortcodes['vc_say_hello'] = array(
'name' => __( 'Say Hello', 'my-text-domain' ),
'base' => 'vc_say_hello',
'category' => __( 'Content', 'my-text-domain' ),
'description' => __( 'Just outputs Hello World', 'my-text-domain' ),
'post_type' => Vc_Grid_Item_Editor::postType(),
);
return $shortcodes;
}
add_shortcode( 'vc_say_hello', 'vc_say_hello_render' );
function vc_say_hello_render() {
if( get_field('item') ):
the_field('item');
else:
echo "<h2>ITEM LOCKED</h2>";
endif;
}
Когда я вызываю шорткод вВ построителе отображается «ПУНКТ ЗАБЛОКИРОВАН», даже если значение элемента установлено в сообщении !!!