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

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Verwenden Sie erweiterte benutzerdefinierte Felder ACF/Init mit einem Optionsfeld und einem Shortcode

by Anonymous » 03 Jun 2025, 19:03

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');

});

Top