Custom Fields
Re-Envisioned
Support General Select_tree with attribute required true not works

  • Creator
    Topic
  • #12429
    Jefferson
    Participant

    When I apply the attribute required true in select_tree field_type, the post is not saved (action save is not fired when I click on button publish/update).

    My code:

    
    array(
      'id'    => 'category-and-types',
      'type' => 'taxonomy',
      'name' => esc_html__( 'Categoria, Tipo e Subtipo', 'webpesados' ),
      'placeholder'   => esc_html__( 'Selecione', 'webpesados' ),
      'taxonomy' => 'category',
      'field_type' => 'select_tree',
      'class' => 'web_select_tree',
      'columns' => 6,
      'attributes' => array(
      'required' => false,
    ),
    
Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #12441
    Anh Tran
    Keymaster

    Hi Jefferson,

    Does the code work when you remove that attribute completely? Setting it false actually doesn’t do anything.

    #12454
    Jefferson
    Participant

    Without the parameter attributes -> required, the code works, but I need that this field be required. Can you help me?

    #12468
    yomisimie
    Participant

    Your code might be incomplete. You’re missing the closing bracket on the attributes array

    #12469
    Jefferson
    Participant

    The code that I paste in ticket really have a unclosed tag. Was a mistake when I try to format the code here after to paste. But in my project, the all bracket are closed and the post is not saved.

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