Add New Items to Taxonomy creates inconsistent results

Support General Add New Items to Taxonomy creates inconsistent resultsResolved

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #20910
    info@yoursolutions.today[email protected]
    Participant

    My plugin includes advanced select boxes for two taxonomies, each of which is configured to enable the 'add_new' function. However, the 'Add New' button only appears for one of the two. The function works properly when I use it via builder, but when I transfer it to php code, it starts erroring.

    The code:

             array (
                    'id' => $prefix . 'author',
                    'type' => 'taxonomy',
                    'name' => esc_html__( 'Author', 'pub-fields' ),
                    'placeholder' => esc_html__( 'Select an author', 'pub-fields' ),
                    'taxonomy' => 'author',
                    'field_type' => 'select_advanced',
                    'multiple' => true,
                    'columns' => 6,
                    'add_new' => true,
                ),
                array (
                    'id' => $prefix . 'org',
                    'type' => 'taxonomy',
                    'name' => esc_html__( 'Publication Organisation', 'pub-fields' ),
                    'placeholder' => esc_html__( 'Select an organisation', 'pub-fields' ),
                    'taxonomy' => 'organisation',
                    'field_type' => 'select_advanced',
                    'multiple' => true,
                    'columns' => 6,
                    'add_new' => true,
                ),

    Image of the result:
    Image of the result

    #20922
    Long NguyenLong Nguyen
    Moderator

    Hi,

    The code works as well on my local site, see this screen record https://www.loom.com/share/8d7532ebe7484c9a87a90291a9714960.

    Could you please share all the code which creates fields? And open the Console tab of the browser to check if there are any error messages.

    #20930
    info@yoursolutions.today[email protected]
    Participant

    Code is available at: https://pastebin.com/LQSEnMYP. There are no particular errors in the console.

    #20932
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Could you please check the taxonomy slug author again? I've tested your code on my local site, and the Add new button display on two taxonomy selects as well.

    #20950
    info@yoursolutions.today[email protected]
    Participant

    that was it - thank you!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.