Home › Forums › General Issues › Update 'Message' field manually in PHP › Reply To: Update 'Message' field manually in PHP
or my favorite way… clien-side scripts =)
function stat_box(){
if (get_post_type()=='YourPostTypeSlug'){
$out = '<script type="text/javascript">';
$out .= 'var myMessage = jQuery(\'.field_type-message:contains("[stat_message_anchor]")\');if (myMessage) myMessage.html(myMessage.html().replace("[stat_message_anchor]","Lorem ipsum goes here..."))'; //changing content
$out .= '</script>';
echo $out;
}
}
add_action('in_admin_footer', 'stat_box');
and just put the text “[stat_message_anchor]” in your message
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.