public static function _save($menu_id, $menu_data = '') { foreach (self::$sections as $section) { foreach ($section['fields'] as $field) { _kc_update_meta('term', 'nav_menu', $menu_id, $section, $field); } } }
public static function _save($menu_id, $menu_item_db_id, $args) { foreach (self::$sections as $section) { foreach ($section['fields'] as $field) { _kc_update_meta('post', 'nav_menu_item', $menu_item_db_id, $section, $field); } } }
/** * Save additional user metadata * * @credit Justin Tadlock * @links http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields * * @param int $user_id User ID * @return null */ public static function _save($user_id) { if (!current_user_can('edit_user', $user_id)) { return $user_id; } foreach (self::$settings as $group) { foreach ($group as $section) { foreach ($section['fields'] as $field) { _kc_update_meta('user', null, $user_id, $section, $field); } } } }
public static function _save($post_id) { if (!current_user_can('edit_post', $post_id)) { return $post_id; } $post = get_post($post_id); if (empty(self::$settings[$post->post_type])) { return $post_id; } $sections = self::_bootstrap_sections(self::$settings[$post->post_type], $post); if (empty($sections) || isset($_POST['action']) && in_array($_POST['action'], array('inline-save', 'trash', 'untrash')) || $post->post_status == 'auto-draft' || empty($_POST["{$post->post_type}_kc_meta_box_nonce"]) || !wp_verify_nonce($_POST["{$post->post_type}_kc_meta_box_nonce"], '___kc_meta_box_nonce___')) { return $post_id; } foreach ($sections as $section) { foreach ($section['fields'] as $field) { _kc_update_meta('post', $post->post_type, $post_id, $section, $field); } } return $post_id; }
/** * Save term meta value * * @param int $term_id Term ID * @param int $tt_id Term Taxonomy ID * @param string $taxonomy Taxonomy name * */ public static function _save($term_id, $tt_id, $taxonomy) { if (!isset(self::$settings[$taxonomy]) || isset($_POST['action']) && $_POST['action'] == 'inline-save-tax') { return $term_id; } foreach (self::$settings[$taxonomy] as $section) { foreach ($section['fields'] as $field) { _kc_update_meta('term', $taxonomy, $term_id, $section, $field); } } }