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.
as you can notice I have some trouble regarding the hook
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.