/** * Runs the actions for active tabspost/page's Muut information. * * @param int $post_id The id of the post (page) being saved. * @param WP_Post $post The post (page) object that is being saved. * @return void * @author Paul Hughes * @since 3.0 */ public function saveMuutPostSettings($post_id, $post) { $tabs = $this->getMetaBoxTabsForCurrentPostType(); $has_last_active = false; $last_active = '0'; foreach ($tabs as $tab_slug => $tab) { // Execute actions for active tabs. // Next line the $_POST index could be a new hidden, if multiple tabs should be saved. if (isset($_POST['muut_tab_last_active_' . $tab['name']]) && $_POST['muut_tab_last_active_' . $tab['name']] == '1') { $has_last_active = true; $last_active = $tab['name']; update_post_meta($post_id, 'muut_last_active_tab', $tab['name']); } if (isset($_POST['muut_tab_last_active_' . $tab['name']]) && $_POST['muut_tab_last_active_' . $tab['name']]) { do_action('muut_save_post_tab', $tab, $post_id, $post); do_action('muut_save_post_tab_' . $tab['name'], $tab, $post_id, $post); } } if (!$has_last_active) { update_post_meta($post_id, 'muut_last_active_tab', '0'); } if ((!$last_active || $last_active != 'forum-tab') && Muut_Post_Utility::getForumPageId() == $post_id) { Muut_Post_Utility::removeAsForumPage($post_id); } }