javascript - Custom metabox with select field allowed to be cloned -


function $this->output_trainer_list() gets list of posts , displays in select field. allow clone field, user can choose more 1 trainer, want allow choose 1 trainer once (if choosen, show disabled). can me?

    $prefix = 'trainer-';      $meta_boxes[] = array(         'id' => 'trainers',         'title' => esc_html__( 'trainers', 'metabox-online-generator' ),         'post_types' => array( 'xxx' ),         'context' => 'advanced',         'priority' => 'low',         'autosave' => false,         'fields' => array(             array(                 'id' => $prefix . 'c_name',                 'type' => 'select',                 'clone' => true,                 'max_clone' => $this->count_trainer_list(),                 'name' => esc_html__( 'wybierz trenera:', 'metabox-online-generator' ),                 'options' => $this->output_trainer_list(),                 ),              ),         );      return $meta_boxes; 


Comments

Popular posts from this blog

html - How to set bootstrap input responsive width? -

javascript - Highchart x and y axes data from json -

javascript - Get js console.log as python variable in QWebView pyqt -