public function __construct($options = array())
 {
     parent::__construct($options);
     // Infer $save_to_post_parent if $only_save_to_post_parent
     if ($this->only_save_to_post_parent) {
         $this->save_to_post_parent = true;
     }
 }
 /**
  * Constructor. Used for validation.
  */
 public function __construct($options = array())
 {
     parent::__construct($options);
     // Validate improper usage of store property
     if (!in_array($this->store_property, $this->allowed_store_properties)) {
         throw new FM_Developer_Exception(sprintf(__('Store property %s is invalid. Must be one of %s.', 'fieldmanager'), $this->store_property, implode(', ', $this->allowed_store_properties)));
     }
     if (!empty($this->reciprocal) && 'ID' != $this->store_property) {
         throw new FM_Developer_Exception(__('You cannot use reciprocal relationships with FM_Datasource_User if store_property is not set to ID.', 'fieldmanager'));
     }
     // Validate improper usage of display property
     if (!in_array($this->display_property, $this->allowed_display_properties)) {
         throw new FM_Developer_Exception(sprintf(__('Display property %s is invalid. Must be one of %s.', 'fieldmanager'), $this->display_property, implode(', ', $this->allowed_display_properties)));
     }
 }
 /**
  * Constructor
  */
 public function __construct($options = array())
 {
     global $wp_taxonomies;
     // default to showing empty tags, which generally makes more sense for the types of fields
     // that fieldmanager supports
     if (!isset($options['taxonomy_args']['hide_empty'])) {
         $options['taxonomy_args']['hide_empty'] = False;
     }
     parent::__construct($options);
     if ($this->only_save_to_taxonomy) {
         $this->taxonomy_save_to_terms = True;
     }
     // make post_tag and category sortable via term_order, if they're set as taxonomies, and if
     // we're not using Fieldmanager storage
     if ($this->only_save_to_taxonomy && in_array('post_tag', $this->get_taxonomies())) {
         $wp_taxonomies['post_tag']->sort = True;
     }
     if ($this->only_save_to_taxonomy && in_array('category', $this->get_taxonomies())) {
         $wp_taxonomies['category']->sort = True;
     }
 }
 /**
  * Constructor
  */
 public function __construct($options = array())
 {
     global $wp_taxonomies;
     // default to showing empty tags, which generally makes more sense for the types of fields
     // that fieldmanager supports
     if (!isset($options['taxonomy_args']['hide_empty'])) {
         $options['taxonomy_args']['hide_empty'] = False;
     }
     parent::__construct($options);
     // Ensure that $taxonomy_save_to_terms is true if it needs to be
     if ($this->only_save_to_taxonomy) {
         $this->taxonomy_save_to_terms = true;
     }
     if ($this->taxonomy_save_to_terms) {
         // Ensure that the taxonomies are sortable if we're not using FM storage.
         foreach ($this->get_taxonomies() as $taxonomy) {
             if (!empty($wp_taxonomies[$taxonomy])) {
                 $wp_taxonomies[$taxonomy]->sort = true;
             }
         }
     }
 }