Function Reference: geodir_admin_current_post_type
Summary
Get the current post type in the WordPress admin
Global Values
- $post
- (null|WP_Post) (required) Post object.
- Default: None
- $typenow
- (string) (required) Post type.
- Default: None
- $current_screen
- (object|WP_Screen) (required) Current screen object.
- Default: None
Package
GeoDirectory
Return Values
- (string)
- Post type ex: gd_place.
Change Log
Since: 1.4.2
Source File
geodir_admin_current_post_type() is located in geodirectory-admin/admin_functions.php [Line: 2124]
Source Code
function geodir_admin_current_post_type() { global $post, $typenow, $current_screen; $post_type = NULL; if (isset($_REQUEST['post_type'])) $post_type = sanitize_key($_REQUEST['post_type']); elseif (isset($_REQUEST['post']) && get_post_type($_REQUEST['post'])) $post_type = get_post_type($_REQUEST['post']); elseif ($post && isset($post->post_type)) $post_type = $post->post_type; elseif ($typenow) $post_type = $typenow; elseif ($current_screen && isset($current_screen->post_type)) $post_type = $current_screen->post_type; return $post_type; }