Useful for presenting an ACF field within WordPress Blocks.
add_shortcode( 'ccom_acf_field', function( $atts ) {
if( ! function_exists( 'get_field' ) || empty( $atts['field'] ) ) {
return;
}
return get_field( $atts['field'] );
} );
Useful for presenting an ACF field within WordPress Blocks.
add_shortcode( 'ccom_acf_field', function( $atts ) {
if( ! function_exists( 'get_field' ) || empty( $atts['field'] ) ) {
return;
}
return get_field( $atts['field'] );
} );
All code snippets are licensed GPLv2 (or later) matching WordPress licensing.
Disclaimer of warranty:
Except when otherwise stated in writing the copyright holders and/or other parties provide the program as-is without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose.