Support

Account

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