Methods summary
public static
|
#
onActivation( )
On plugin activation set the activated flag
On plugin activation set the activated flag
|
public static
|
|
public static
mixed
|
#
getService( string $name )
Get a service from the container
Get a service from the container
Parameters
Returns
mixed The service instance
|
public static
string
|
#
url( string $path = '' )
Get the URL to the plugin folder
Get the URL to the plugin folder
Parameters
- $path
- Extra path to append to the URL
Returns
string
|
public static
string
|
#
adminUrl( string $path = '' )
Get the URL to the plugin admin folder
Get the URL to the plugin admin folder
Parameters
- $path
- Extra path to append to the URL
Returns
string
|
public static
string
|
#
getPluginName( )
Allow users to white-label the plugin name on Quform pages
Allow users to white-label the plugin name on Quform pages
Returns
string The plugin name
|
public static
string
|
#
getClientIp( )
Get the IP address of the visitor
Get the IP address of the visitor
Returns
string
|
public static
string
|
|
public static
string
|
|
public static
WP_Post|null
|
|
public static
string
|
#
getPostProperty( string $property = 'ID', integer|null $postId = null )
Get a property from the current post object
Get a property from the current post object
Parameters
- $property
- Which property to get
- $postId
- The post ID or null to use the current post
Returns
string
|
public static
mixed|string
|
#
getPostMeta( string $key, integer|null $postId = null )
Get the post meta value with the given key from the given post ID or the current post
Get the post meta value with the given key from the given post ID or the current post
Parameters
- $key
- The post meta key
- $postId
- The post ID, if null the current post will be used
Returns
mixed|string
|
public static
string
|
#
getUserProperty( string $property = 'ID' )
Get a property from the current user object
Get a property from the current user object
Parameters
- $property
- Which property to get
Returns
string
|
public static
mixed|string
|
#
getUserMeta( string $key )
Get the user meta value with the given key for the current user
Get the user meta value with the given key for the current user
Parameters
Returns
mixed|string
|
public static
string
|
#
studlyCase( string $value )
Convert the given string to studly case
Convert the given string to studly case
Parameters
Returns
string
|
public static
boolean
|
#
isGetRequest( )
Is the current request a GET request?
Is the current request a GET request?
Returns
boolean
|
public static
boolean
|
#
isPostRequest( )
Is the current request a POST request?
Is the current request a POST request?
Returns
boolean
|
public static
string
|
#
escape( string $value, integer $flags = ENT_QUOTES )
Escaping for strings in HTML
Escaping for strings in HTML
Identical to esc_html but with double encoding true
Parameters
Returns
string
|
public static
string
|
#
sanitizeClass( string|array $classes )
Sanitize multiple classes
Sanitize multiple classes
Parameters
- $classes
- Classes to sanitize
Returns
string The sanitized classes
|
public static
string
|
#
sanitizeTextareaField( string $str )
Sanitizes a multiline string
Sanitizes a multiline string
Parameters
Returns
string
|
public static
mixed
|
#
get( array $array, string $key = null, mixed $default = null )
Get a value from an array, allowing dot notation
Get a value from an array, allowing dot notation
Parameters
Returns
mixed
|
public static
array
|
#
set( array & $array, string $key, mixed $value )
Set an array item to a given value using "dot" notation.
Set an array item to a given value using "dot" notation.
If no key is given to the method, the entire array will be replaced.
Parameters
Returns
array
|
public static
|
#
forget( array & $array, array|string $keys )
Remove one or many array items from a given array using "dot" notation.
Remove one or many array items from a given array using "dot" notation.
Parameters
|
public static
boolean
|
#
isNonEmptyString( mixed $value )
Returns true if and only if the given value is a string with at least one character
Returns true if and only if the given value is a string with at least one character
Parameters
Returns
boolean
|
public static
|
#
dd( )
Die and dump arguments, debugging helper method
Die and dump arguments, debugging helper method
|
public static
|
#
log( )
Log arguments to the PHP error log
Log arguments to the PHP error log
|
public static
|
#
debug( )
Log arguments to the PHP error log only if WP_DEBUG is enabled
Log arguments to the PHP error log only if WP_DEBUG is enabled
|
public static
integer
|
#
strlen( string $string )
Get the length of the given string (multibyte aware)
Get the length of the given string (multibyte aware)
Parameters
Returns
integer
|
public static
string
|
#
substr( string $string, integer $start, integer|null $length = null )
Get part of the given string (multibyte aware)
Get part of the given string (multibyte aware)
Parameters
Returns
string
|
public static
string
|
#
getHtmlTag( string $tag, array $attributes = array(), string $content = '' )
Generates an HTML tag
Parameters
- $tag
- The HTML tag
- $attributes
- Attributes key => value list for the tag
- $content
- Content for non-void elements (not escaped)
Returns
string
|
public static
string
|
#
parseHtmlAttributes( array $attributes )
Parse an array of HTML attributes into an attribute string
Parse an array of HTML attributes into an attribute string
Parameters
- $attributes
- Attributes key => value list for the tag
Returns
string
|
public static
string
|
#
randomBytes( integer $length )
Get random bytes with the given $length
Get random bytes with the given $length
Parameters
Returns
string
|
public static
string
|
#
randomString( integer $length )
Generate a random string with the given $length
Generate a random string with the given $length
Parameters
Returns
string
|
public static
|
#
setCookie( string $name, string $value, integer $expire, boolean $secure = false, boolean $httpOnly = false, boolean $logFailure = false )
Set a cookie
Parameters
- $name
- The name of the cookie
- $value
- The value of the cookie
- $expire
- The time the cookie expires as Unix timestamp
- $secure
- Send the cookie over HTTPS only
- $httpOnly
- Make the cookie only accessible over the HTTP protocol
- $logFailure
- Make a log entry if the cookie could not be created because headers already sent
|
public static
mixed
|
#
clamp( mixed $x, mixed $min, mixed $max )
Ensure the given number $x is between $min and $max inclusive
Ensure the given number $x is between $min and $max inclusive
Parameters
Returns
mixed
|
public static
string
|
#
getTempDir( string $extra = '' )
Get a writable temporary directory
Get a writable temporary directory
Parameters
- $extra
- Extra path to append to the path
Returns
string Path without trailing slash
|
public static
string
|
#
getUploadsUrl( string $extra = '' )
Get the URL to the WP uploads directory
Get the URL to the WP uploads directory
Parameters
- $extra
- Extra path to append to the path
Returns
string
|
public static
string|false
|
#
getUploadsDir( string $extra = '' )
Get the absolute path to the WordPress upload directory. If the path is not writable it will return false.
Get the absolute path to the WordPress upload directory. If the path is not writable it will return false.
Parameters
- $extra
- Extra path to append to the path
Returns
string|false The upload path or false on failure
|
public static
boolean
|
#
hasPcreUnicodeSupport( )
Is PCRE compiled with Unicode support?
Is PCRE compiled with Unicode support?
Returns
boolean
|
public static
array
|
#
getLocales( )
Get the available locales for Kendo scripts
Get the available locales for Kendo scripts
Returns
array
|
public static
array
|
#
getLocale( string $locale = '' )
Get the locale data with the given locale code
Get the locale data with the given locale code
If the locale does not exist, the default en-US locale will be returned
Parameters
Returns
array
|
public static
string
|
#
getPluginIcon( string $color = '' )
Get the plugin icon SVG in the given color
Get the plugin icon SVG in the given color
Parameters
Returns
string
|
public static
boolean
|
#
currentUserCan( array|string $caps )
Does the current user have any of the given capabilities?
Does the current user have any of the given capabilities?
Deprecated
2.1.0
Parameters
Returns
boolean
|
public static
string
|
#
addCssUnit( string $value )
If the value is a non-zero number it will append 'px' otherwise return the value unchanged
If the value is a non-zero number it will append 'px' otherwise return the value unchanged
Parameters
Returns
string
|
public static
string
|
#
formatCount( integer $count )
Format the given count into thousands if necessary e.g. 1100 becomes 1.1k
Format the given count into thousands if necessary e.g. 1100 becomes 1.1k
Parameters
Returns
string
|
public static
string
|
#
base64UrlEncode( mixed $data )
Base 64 encode the given data in a format safe for URLs
Base 64 encode the given data in a format safe for URLs
Credit: http://php.net/manual/en/function.base64-encode.php#103849
Parameters
Returns
string
|
public static
array
|
#
getPages( )
Get all pages in an array formatted for select2
Get all pages in an array formatted for select2
Deprecated
2.10.0
Returns
array
|
public static
array
|
#
getPosts( )
Get all posts in an array formatted for select2
Get all posts in an array formatted for select2
Deprecated
2.10.0
Returns
array
|
public static
string
|
#
getPostTitle( WP_Post $post )
Get the title of the given post
Get the title of the given post
Deprecated
2.10.0
Parameters
Returns
string
|
public static
string
|
#
getPostTitleById( integer $id )
Get the title of the post by ID
Get the title of the post by ID
Parameters
Returns
string The post title
|
public static
array
|
#
searchPosts( string $search )
Search all public post types for the given search term
Search all public post types for the given search term
Parameters
Returns
array
|
public static
array
|
#
searchUsers( string $search )
Search all users for the given search term
Search all users for the given search term
Parameters
Returns
array
|
public static
string|false
|
#
date( string $format, DateTime $date = null, DateTimeZone $timezone = null )
Format a date
Parameters
- $format
- The format of the returned date
- $date
- The DateTime instance representing the moment of time in UTC, or null for the current time
- $timezone
- The timezone of the returned date, will default to the WP timezone if omitted
Returns
string|false The formatted date or false if there was an error
|
public static
DateTimeZone
|
#
getTimezone( )
Get the WP timezone as a DateTimeZone instance
Get the WP timezone as a DateTimeZone instance
Duplicate of wp_timezone() for WP <5.3.
Returns
DateTimeZone
|
public static
string
|
#
getTimezoneString( )
Get the WP timezone as a string
Get the WP timezone as a string
Duplicate of wp_timezone_string() for WP <5.3.
Returns
string
|
public static
integer|boolean
|
#
compareDates( string $first, string $second )
Compare the two given dates
Compare the two given dates
Returns: -1 if first is before second 0 if the dates are the same 1 if first is after the second
false if either date is invalid
Parameters
- $first
- The first date in YYYY-MM-DD format
- $second
- The second date in YYYY-MM-DD format
Returns
integer|boolean
|