Support

Account

Home Forums Front-end Issues Tag field with auto-creation of new tags Reply To: Tag field with auto-creation of new tags

  • I suppose that most people find the existing field enough.

    As far as adding this to ACF, you’d need to ask the developer https://www.advancedcustomfields.com/contact/

    Here’s another option because most of the issue stems from needing to click on the + link when hovering over the field. Add an acf/render_field filter https://www.advancedcustomfields.com/resources/acf-render_field/. This solution depends on JQuery being loaded, which it should be.

    
    // replace field_XXXX with your field key
    add_filter('acf/render_field/key=field_XXXX', 'add_term_add_link', 20, 1);
    function add_term_add_link($field) {
      ?>
        <a href="javascript: $('[data_key="field_XXXX"] .acf-input [data-name="add"]').trigger('click');">Add a Category</a>
      <?php 
    }
    

    What this does is to add a link below the field that when clicked will trigger the same action as clicking on the +. You can then style it as a button or whatever makes the most sense.