PHP Class _WPLib_WP_Helpers, wplib

Provide a WordPress Helper class for WPLib. Basically, this class contributes static methods to the WPLib class using magic methods.
Inheritance: extends WPLib_Helper_Base
Show file Open project: wplib/wplib Class Usage Examples

Public Methods

Method Description
current_screen ( ) : WP_Screen Returns the "current screen."
has_query_var ( string $var_name, string | boolean $expected_value = null ) : boolean Return true if a URL query var is not empty and optionally matches an expected value.
is_page ( integer $page_id ) : boolean Is the Front Page configured to display a $post_type='page'?
maybe_make_abspath_relative ( string $filepath ) : string Takes a filepath and potentially returns a relative path (prefixed with '~/'), if $filepath begins with ABSPATH.
on_load ( )

Method Details

current_screen() static public method

Same as WordPress' get_current_screen() but will call set_current_screen() if is null.
Since: 0.9.9
static public current_screen ( ) : WP_Screen
return WP_Screen

has_query_var() static public method

Return true if a URL query var is not empty and optionally matches an expected value.
static public has_query_var ( string $var_name, string | boolean $expected_value = null ) : boolean
$var_name string
$expected_value string | boolean
return boolean

is_page() static public method

Is the Front Page configured to display a $post_type='page'?
static public is_page ( integer $page_id ) : boolean
$page_id integer
return boolean

maybe_make_abspath_relative() static public method

Takes a filepath and potentially returns a relative path (prefixed with '~/'), if $filepath begins with ABSPATH.
static public maybe_make_abspath_relative ( string $filepath ) : string
$filepath string
return string

on_load() static public method

static public on_load ( )