PluginProbe ʕ •ᴥ•ʔ
Gallery : FooGallery / 3.1.36
Gallery : FooGallery v3.1.36
3.3.2 3.3.3 3.3.0 3.1.31 3.1.32 3.1.34 3.1.36 3.2.0 3.2.6 trunk 1.10.3 2.0.24 2.1.34 2.2.44 2.3.3 2.4.32 3.0.6 3.1.11 3.1.12 3.1.13 3.1.20 3.1.25 3.1.26 3.1.26.1 3.1.26.2
foogallery / includes / foopluginbase / functions / screen.php
foogallery / includes / foopluginbase / functions Last commit date
arrays.php 2 months ago dates.php 2 months ago general.php 2 months ago index.php 2 months ago screen.php 2 months ago strings.php 2 months ago
screen.php
52 lines
1 <?php
2 /*
3 * Foo Functions - Screen
4 * A bunch of common and useful functions related to WP_screen object
5 *
6 * Author: Brad Vincent
7 * Author URI: http://fooplugins.com
8 * License: GPL2
9 */
10
11 if ( !function_exists( 'foo_current_screen_id' ) ) {
12 function foo_current_screen_id() {
13 $screen = get_current_screen();
14 if ( empty($screen) ) return false;
15
16 return $screen->id;
17 }
18 }
19
20 if ( !function_exists( 'foo_current_screen_base' ) ) {
21 function foo_current_screen_base() {
22 $screen = get_current_screen();
23 if ( empty($screen) ) return false;
24
25 return $screen->base;
26 }
27 }
28
29 if ( !function_exists( 'foo_current_screen_post_type' ) ) {
30 function foo_current_screen_post_type() {
31 $screen = get_current_screen();
32 if ( empty($screen) ) return false;
33
34 return $screen->post_type;
35 }
36 }
37
38 if ( !function_exists( 'foo_check_plugin_settings_page' ) ) {
39 function foo_check_plugin_settings_page($plugin_slug) {
40 return is_admin() && 'settings_page_' . $plugin_slug === foo_current_screen_id();
41 }
42 }
43
44 if ( !function_exists( 'foo_current_url' ) ) {
45 // returns the current URL
46 function foo_current_url() {
47 global $wp;
48 $current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );
49
50 return $current_url;
51 }
52 }