WordPress at a glance
Home Functions Other Functions Helper Functions

Helper Functions (category)

__return_empty_array()

Simply returns an empty array: array(). Helper function of WordPress.

__return_empty_string()

Simply returns an empty string:". Helper function of WordPress.

__return_false()

Simply returns false. Helper function of WordPress.

__return_null()

Simply returns null. Auxiliary function of WordPress.

__return_true()

Simply returns true. Helper function of WordPress.

__return_zero()

Simply returns 0. Helper function of WordPress. Useful for use in filters.

build_query()

Build URL query based on an associative and, or indexed array.

get_page_hierarchy()

Order the pages with children under parents in a flat list.

get_temp_dir()

Determine a writable directory for temporary files.

human_readable_duration()

Convert a duration in format HH:ii:ss or ii:ss to human readable format.

is_email()

Verifies that an email is valid.

is_php_version_compatible()

Checks compatibility with the current PHP version.

is_serialized()

Check the given value if it's a serialized string.

is_serialized_string()

Check whether serialized data is of string type.

is_wp_version_compatible()

Checks compatibility with the current WordPress version.

map_deep()

Applies the specified function to the values of the passed array/object/string/number. It's a recursive function.

maybe_serialize()

Serialize data, if needed.

maybe_unserialize()

Unserialize value only if it was serialized.

path_join()

Join two filesystem paths together. If the second parameter is an absolute path (starts with a slash), then only it will be returned.

seems_utf8()

Checks to see if a string is UTF-8 encoded.

stripslashes_deep()

Navigates through an array, object, or scalar, and removes slashes from the values.

timer_stop()

Retrieve or display the time from the page start to when function is called.

urlencode_deep()

Navigates through an array, object, or scalar, and encodes the values to be used in a URL.

wp_array_slice_assoc()

Extract a slice of an array, given a list of keys.

wp_basename()

i18n friendly version of basename()

wp_debug_backtrace_summary()

Return a comma-separated string of functions that have been called to get to the current point in code.

wp_doing_ajax()

Determines whether the current request is a WordPress Ajax request.

wp_extract_urls()

Use RegEx to extract URLs from arbitrary content.

wp_filter_object_list()

Filters a list of objects, based on a set of key => value arguments.

wp_generate_uuid4()

Generate a random UUID (version 4).

wp_html_split()

Separate HTML elements and comments from the text.

wp_is_numeric_array()

Determines if the variable is a numeric-indexed array.

wp_is_uuid()

Validates that a UUID is valid.

wp_json_encode()

Encode a variable into JSON, with some sanity checks. Checks strings and translates them to UTF-8.

wp_kses_array_lc()

Goes through an array and changes the keys to all lower case.

wp_kses_hair()

Builds an attribute list from string containing attributes.

wp_kses_uri_attributes()

Helper function listing HTML attributes containing a URL.

wp_list_filter()

Filters a list of objects, based on a set of key => value arguments.

wp_list_pluck()

Pluck a certain field out of each object in a list.

wp_list_sort()

Sorts a list of objects, based on one or more orderby arguments.

wp_make_link_relative()

Convert full URL paths to absolute paths.

wp_mkdir_p()

Recursive directory creation based on full path.

wp_normalize_path()

Normalize a filesystem path.

wp_parse_args()

Merge user defined arguments into defaults array.

wp_parse_id_list()

Clean up an array, comma- or space-separated list of IDs.

wp_parse_list()

Cleans up an array, comma- or space-separated list of scalar values.

wp_parse_slug_list()

Clean up an array, comma- or space-separated list of slugs.

wp_parse_str()

Parses a string into variables to be stored in an array.

wp_parse_url()

Parses a URL and returns its components. A wrapper for PHP's parse_url() function that handles consistency in the return values across PHP versions.

wp_rand()

Generates a random number between the specified min and max.

wp_reset_vars()

Resets global variables based on $_GET and $_POST

wp_send_json()

Send a JSON response back to an Ajax request.

wp_send_json_error()

Send a JSON response back to an Ajax request, indicating failure.

wp_send_json_success()

Returns JSON data. Is used to return a success response to AJAX request. The response object always contains the element success=true. die() php execution.

wp_slash()

Add slashes (\) to a string or array of strings.

wp_spaces_regexp()

Returns the regexp for common whitespace characters.

wp_sprintf()

WordPress implementation of PHP sprintf() with filters.

wp_tempnam()

Returns a filename of a Temporary unique file. Please note that the calling function must unlink() this itself.

wp_unslash()

Remove slashes from a string or array of strings.

wp_validate_boolean()

Filter/validate a variable as a boolean.