Support

Account

Home Forums General Issues Labels on Title and Content

Solved

Labels on Title and Content

    • utvik

    • April 13, 2020 at 6:36 am

    Hi,

    I’m using acf_form to display a form on the frontend, but it seems impossible to override the default labels for Title and Content for a single post type.

    I looked at prepare_field filter, but it’s only possible to update based on key and name (which also seems to be identical). Also field doesn’t contain the name of the post type.

    Am I missing something here? Or is this a limitation with acf? Would it make sense to raise a feature request to include the field_group in the $field?

    Or is there some way to find out which new_post -> post_type this belongs to?

    array(23) {
      ["ID"]=>
      int(0)
      ["key"]=>
      string(11) "_post_title"
      ["label"]=>
      string(5) "Title"
      ["name"]=>
      string(16) "acf[_post_title]"
      ["prefix"]=>
      string(3) "acf"
      ["type"]=>
      string(4) "text"
      ["value"]=>
      string(0) ""
      ["menu_order"]=>
      int(0)
      ["instructions"]=>
      string(0) ""
      ["required"]=>
      bool(true)
      ["id"]=>
      string(15) "acf-_post_title"
      ["class"]=>
      string(0) ""
      ["conditional_logic"]=>
      bool(false)
      ["parent"]=>
      string(0) ""
      ["wrapper"]=>
      array(3) {
        ["width"]=>
        string(0) ""
        ["class"]=>
        string(0) ""
        ["id"]=>
        string(0) ""
      }
      ["_name"]=>
      string(11) "_post_title"
      ["_valid"]=>
      int(1)
      ["default_value"]=>
      string(0) ""
      ["maxlength"]=>
      string(0) ""
      ["placeholder"]=>
      string(0) ""
      ["prepend"]=>
      string(0) ""
      ["append"]=>
      string(0) ""
      ["_prepare"]=>
      bool(true)
    }
  • There isn’t a way to alter these titles. Instead you would need to use a custom ACF field and then use the values of these to update the title and content. There is code on this page for an example of using an ACF field for title and content would work in a similar way https://support.advancedcustomfields.com/forums/topic/using-a-field-to-define-a-new-post-title-with-acf_form/

  • i got it, thank you for the explanation.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.