Esempio n. 1
0
 /**
  * @param WP_Post $field_group_post Post object representing a user field group.
  * @throws InvalidArgumentException
  */
 public function __construct($field_group_post)
 {
     parent::__construct($field_group_post);
     if (self::POST_TYPE != $field_group_post->post_type) {
         throw new InvalidArgumentException('incorrect post type');
     }
 }
Esempio n. 2
0
 /**
  * Update cache after a field group is renamed.
  *
  * @param string $original_name The old name of the field group.
  * @param Types_Field_Group $field_group The field group involved, with already updated name.
  */
 public function field_group_renamed($original_name, $field_group)
 {
     if ($field_group->get_post_type() == $this->get_post_type()) {
         $this->clear_from_cache($original_name);
         $this->save_to_cache($field_group);
     }
 }
Esempio n. 3
0
 /**
  * @inheritdoc
  *
  * Add term field group-specific information to the export object.
  *
  * @return array
  * @since 2.1
  */
 protected function get_export_fields()
 {
     $data = parent::get_export_fields();
     // Array of slugs of associated taxonomies.
     $associated_taxonomy_data = implode(',', $this->get_associated_taxonomies());
     // parent::XML_META_SECTION is ensured by the parent method
     $data[parent::XML_META_SECTION][self::POSTMETA_ASSOCIATED_TAXONOMY] = $associated_taxonomy_data;
     return $data;
 }
Esempio n. 4
0
 /**
  * Get the db identifier (uses id of group)
  *
  * @return string
  */
 protected function get_db_identifier_legacy()
 {
     return sprintf($this->get_db_pattern(), $this->group->get_id());
 }