Page 1 of 1

Verwenden Sie erweiterte benutzerdefinierte Felder ACF/Init mit einem Optionsfeld und einem Shortcode

Posted: 03 Jun 2025, 19:03
by Anonymous
Ich erhalte den PHP -Fehler "Aufruf auf undefinierte Funktion get_field" von Zeit zu Zeit, aber nicht konsequent. Bulletins wird am vorderen Ende nicht angezeigt. />
https://www.advancedCustomfields.com/re ... ions-page/
In meinem Code unten:
Ich verwende ACF/init/code> richtig in Funktionen. ACF/init ?
Was ist mit der Verwendung des Shortcode? Ist das ein Problem? < /P>

Code: Select all

add_action('acf/init', function() {

$bulletin_text = get_field('bulletin_text', 'option');

function show_shortcode_bulletin(){
global $bulletin_text;
return $bulletin_text;
}
add_shortcode('bulletins', 'show_shortcode_bulletin');

});