Home › Forums › Backend Issues (wp-admin) › Replacing custom post type post title with an acf? › Reply To: Replacing custom post type post title with an acf?
Edit: [SOLVED] It is enogh use the $value and store it even if the var_dump( $value )
gives me two strings.
Hi @Elliot,
as you can notice I have some trouble regarding the hook add_filter('acf/update_value/name=long_tit');
I am customizing your functionality in order to remove the default WordPress title and set it (and the slug) with the info I can get from a text field.
You can check all the code at this Gist (https://gist.github.com/AndreaBarghigiani/aac1f96a95dc03d7a100) but the thing I do not understand is why my value is been repeated. Here is an example of a var_dump() on the variable that will contain get_field('titolo_lunghissimo', $post_id) . ' ' . $value;
string(5) " Test" string(9) "Test Test"
Why it is set as two string instead of one? And why I can’t put my hands on the first string?
Can you help me up with this?
Thanks in advance for the tool and for the help
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.