function admin_options_save($post_id) { if (!it_check_save_action($post_id, 'page')) { return $post_id; } $grid = new GridPortfolio($this->post_id); $grid->update_from_array($_POST)->save(); }
/** * Save meta box. */ function gp_background_meta_box_save($post_id) { if (!it_check_save_action($post_id, 'page')) { return $post_id; } $text_color = it_get_key_value($_POST, 'gp_background_text_color'); update_post_meta($post_id, 'gp_background_text_color', $text_color); $top = it_get_key_value($_POST, 'gp_box_position_top'); update_post_meta($post_id, 'gp_box_position_top', $top); $left = it_get_key_value($_POST, 'gp_box_position_left'); update_post_meta($post_id, 'gp_box_position_left', $left); $position = it_get_key_value($_POST, 'gp_background_content_position'); update_post_meta($post_id, 'gp_background_content_position', $position); $bg_position = it_get_key_value($_POST, 'gp_background_background_position'); update_post_meta($post_id, 'gp_background_background_position', $bg_position); $bg_dim = isset($_POST['gp_background_dim_background']) ? 1 : 0; update_post_meta($post_id, 'gp_background_dim_background', $bg_dim); }
function meta_box_options_content_save($post_id) { if (!it_check_save_action($post_id, 'gp_portfolio')) { return $post_id; } $project = new PortfolioProject($post_id); $project->update_from_array($_POST); if (it_key_is_array($_POST, 'gp_project_info_title')) { $titles = $_POST['gp_project_info_title']; $contents = $_POST['gp_project_info_content']; $data = array(); foreach ($titles as $index => $title) { if (!empty($title) && !empty($contents[$index])) { $data[] = array('title' => $title, 'content' => $contents[$index]); } } $project->meta_info = $data; } else { $project->meta_info = array(); } $project->save(); }
/** * Save meta box. */ function gp_video_meta_box_save($post_id) { if (!it_check_save_action($post_id)) { return $post_id; } $embed = isset($_POST['gp_embed']) ? $_POST['gp_embed'] : ''; update_post_meta($post_id, 'gp_embed', $embed); }
/** * Save meta box. */ function gp_link_meta_box_save($post_id) { if (!it_check_save_action($post_id)) { return $post_id; } $data = gp_link_get_data($post_id); foreach (array_keys($data) as $key) { $value = isset($_POST['gp_' . $key]) ? $_POST['gp_' . $key] : ''; update_post_meta($post_id, 'gp_' . $key, $value); } }
/** * Save meta box. */ function gp_quote_meta_box_save($post_id) { if (!it_check_save_action($post_id)) { return $post_id; } $quote = isset($_POST['gp_quote']) ? $_POST['gp_quote'] : ''; update_post_meta($post_id, 'gp_quote', $quote); $quote_color = isset($_POST['gp_quote_text_color']) ? $_POST['gp_quote_text_color'] : ''; update_post_meta($post_id, 'gp_quote_text_color', $quote_color); $quote_author = isset($_POST['gp_quote_author']) ? $_POST['gp_quote_author'] : ''; update_post_meta($post_id, 'gp_quote_author', $quote_author); }