/** * WPCF_Field_Group_Term constructor. * * @param WP_Post $field_group_post Post object representing a term 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'); } }
/** * Update cache after a field group is renamed. * * @param string $original_name The old name of the field group. * @param WPCF_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); } }