Home › Forums › General Issues › Subheadline Text Delayed when Publishing? › Reply To: Subheadline Text Delayed when Publishing?
Hi @Nitruc
The code above is an example, to demonstrate how a filter can be added. It is not to be taken literally as you have done.
Your errors say that you are trying to call a function ‘heading2’, but your above code does not show any reference to this.
What you want to do is something like this:
<?php
function custom_post_title( $value, $post_id, $field )
{
// update the $post via the wp_update_post function
return $value;
}
// acf/update_value/name={$field_name} - filter for a specific field based on it's name
add_filter('acf/update_value/name=heading2', 'custom_post_title', 10, 3);
?>
Does that help?
Thanks
E
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.