resolve_path('includes', 'wpalchemy/MetaBox'); } $uri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : NULL ; if ( isset( $uri ) ) { $uri_parts = parse_url($uri); $file = basename($uri_parts['path']); if ($uri AND in_array($file, array('post.php', 'post-new.php'))) { $post_id = WPAlchemy_MetaBox::_get_post_id(); $post_type = isset($_GET['post_type']) ? $_GET['post_type'] : NULL ; $post_type = $post_id ? get_post_type($post_id) : $post_type ; if (isset($post_type)) { return $post_type; } else { // because of the 'post.php' and 'post-new.php' checks above, we can default to 'post' return 'post'; } } } return NULL; } }