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

networking - Vagrant-provisioned VirtualBox VM is not reachable from Ubuntu host -

c# - ASP.NET Core - There is already an object named 'AspNetRoles' in the database -

ruby on rails - ArgumentError: Missing host to link to! Please provide the :host parameter, set default_url_options[:host], or set :only_path to true -