Class question
A utility class that queries WP.
Namespace: ski
Located at packages/ski.web/services/ski.wp.question.php
Methods summary
public static
boolean
|
#
does_table_exist( string $table_name )
Given a table name, this function looks at the current WP database to
determine if that table exists.
Given a table name, this function looks at the current WP database to
determine if that table exists.
Parameters
- $table_name
string $table_name The full name of the table (including prefix 'wp_', for instance)
Returns
boolean 'true' if the table does exist
|
public static
boolean
|
#
is_admin_screen( string $screen_id )
Determines if the user is currently looking at a specific screen - typically
used in the Administrative area.
Determines if the user is currently looking at a specific screen - typically
used in the Administrative area.
Here are some IDs of popular screens: nav-menus => Appearance > Menus
widgets => Appearance > Widgets
Note: This does not work with the Customizer. Use "is_customizer"
instead.
Parameters
- $screen_id
string $screen_id The ID of the screen to test
Returns
boolean true if on the screen with the desired ID; otherwise, false
|
public static
boolean
|
#
is_customizer( )
Determines if the user is currently looking at the Theme Customizer typically
found under Appearance >> Customize.
Determines if the user is currently looking at the Theme Customizer typically
found under Appearance >> Customize.
Note: the API for "get_current_screen" appears to be undefined when in the
Customizer, so the test for a customizer is different than calling
"is_admin_screen".
Returns
boolean
|
public static
string
|
#
locate_template_uri( string|array $template_names )
This is a copy of the 3.9.1 version of WP's locate_template - the primary
difference here makes the use of:
get_xxx_directory_uri
This is a copy of the 3.9.1 version of WP's locate_template - the primary
difference here makes the use of: get_xxx_directory_uri
Instead of: get_xxx_directory (or the XXXPATH constant)
For the return value. This was put into place because file_exists does not
work with the 'http://' (uri example), but does work with 'c:\' (local example).
It is a subtle difference, but one that works in cases where the return value
will not necessarily be used in a 'require' call.
Parameters
- $template_names
string|array $template_names Template file(s) to search for, in order.
Returns
string The template filename if one is located.
|
Magic methods summary