custom field shortcode
-
Hi all
I’m using this piece of custom field code posted by zarie3 a year ago:
//
function get_custom_field( $atts, $content ) {
return get_field($atts[‘fname’]);
}
add_shortcode( ‘ke_get_field’, ‘get_custom_field’ );
//Everything works fine on the live site using PHP7.3, but when I try to use the site on localhost via WAMP (Windows 64), using PHP7.3.1 I get the following warning, and the site won’t load:
( ! ) Warning: Use of undefined constant ‘ke_get_field’ – assumed ‘‘ke_get_field’’ (this will throw an Error in a future version of PHP) in C:\wamp64\www\NACHP\wp-content\themes\NACHP\functions.php on line 91
I understand that that there were deprecation of certain functions in PHP 7.2.1, but can’t see why it works on my Ionos cloud server and not on localhost.
I’m not a php guy, and would appreciate any help with this, especially if there is a workaround.
Cheers
- The topic ‘custom field shortcode’ is closed to new replies.