/**
  * Validates the arguments array.
  *
  * @since 0.5.0
  */
 public function validate($parent = null)
 {
     $status = parent::validate($parent);
     if ($status === true) {
         if (null === $this->args['capability']) {
             $this->args['capability'] = 'edit_theme_options';
         }
         if (isset($this->args['priority'])) {
             if (null === $this->args['position']) {
                 $this->args['position'] = $this->args['priority'];
             }
             unset($this->args['priority']);
         }
         $this->args = Utility::validate_position_args($this->args);
     }
     return $status;
 }
 /**
  * Validates the arguments array.
  *
  * @since 0.5.0
  */
 public function validate($parent = null)
 {
     $status = parent::validate($parent);
     if ($status === true) {
         if (null === $this->args['capability']) {
             $this->args['capability'] = $parent->capability;
         }
         if (isset($this->args['priority'])) {
             if (null === $this->args['position']) {
                 $this->args['position'] = $this->args['priority'];
             }
             unset($this->args['priority']);
         }
         $this->args = Utility::validate_position_args($this->args);
         if (null === $this->args['mode']) {
             $this->args['mode'] = $parent->get_parent()->mode;
         }
         if (is_array($this->args['class'])) {
             $this->args['class'] = implode(' ', $this->args['class']);
         }
         if (isset($this->args['options']) && !is_array($this->args['options'])) {
             $this->args['options'] = array();
         }
         if (in_array($this->args['type'], array('multiselect', 'multibox'), true)) {
             return new UtilError('multichoice_not_supported', sprintf(__('The multichoice field type assigned to the field component %s is not supported in the Customizer.', 'customizer-definitely'), $this->slug), '', ComponentManager::get_scope());
         }
         if ('repeatable' == $this->args['type']) {
             return new UtilError('repeatable_not_supported', sprintf(__('The repeatable field type assigned to the field component %s is not supported in the Customizer.', 'customizer-definitely'), $this->slug), '', ComponentManager::get_scope());
         }
         $this->_field = FieldManager::get_instance($this->args);
         if (null === $this->_field) {
             return new UtilError('no_valid_field_type', sprintf(__('The field type %1$s assigned to the field component %2$s is not a valid field type.', 'customizer-definitely'), $this->args['type'], $this->slug), '', ComponentManager::get_scope());
         }
         if (null === $this->args['default']) {
             $this->args['default'] = $this->_field->validate();
         }
         $this->args['preview_args'] = Customizer::instance()->validate_preview_args($this->args['preview_args'], $this->args['type'], $this->_field);
         if (null === $this->args['transport']) {
             if ($this->args['preview_args']['update_callback']) {
                 $this->args['transport'] = 'postMessage';
             } else {
                 $this->args['transport'] = 'refresh';
             }
         }
     }
     return $status;
 }