Support

Account

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