function tmm_save_details() { if (is_admin()) { if (!empty($_POST)) { if (isset($_POST['tmm_meta_saving'])) { global $post; $post_type = get_post_type($post->ID); switch ($post_type) { case 'page': case 'post': case TMM_Portfolio::$slug: case TMM_Gallery::$slug: case TMM_Staff::$slug: TMM_Gallery::save($post->ID); TMM_Staff::save($post->ID); TMM_Portfolio::save($post->ID); break; case 'testimonials': TMM_Testimonials::save($post->ID); break; default: break; } TMM_Page::save($post->ID); //for all types } } } }