[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

title

Body

[close]

/wp-includes/ -> functions.php (summary)

Main WordPress API

File Size: 6440 lines (196 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 4 files
 wp-includes/default-widgets.php
 wp-includes/option.php
 wp-includes/class-IXR.php
 wp-admin/includes/file.php

Defines 165 functions

  mysql2date()
  current_time()
  date_i18n()
  wp_maybe_decline_date()
  number_format_i18n()
  size_format()
  get_weekstartend()
  maybe_unserialize()
  is_serialized()
  is_serialized_string()
  maybe_serialize()
  xmlrpc_getposttitle()
  xmlrpc_getpostcategory()
  xmlrpc_removepostdata()
  wp_extract_urls()
  do_enclose()
  wp_get_http_headers()
  is_new_day()
  build_query()
  _http_build_query()
  add_query_arg()
  remove_query_arg()
  wp_removable_query_args()
  add_magic_quotes()
  wp_remote_fopen()
  wp()
  get_status_header_desc()
  status_header()
  wp_get_nocache_headers()
  nocache_headers()
  cache_javascript_headers()
  get_num_queries()
  bool_from_yn()
  do_feed()
  do_feed_rdf()
  do_feed_rss()
  do_feed_rss2()
  do_feed_atom()
  do_robots()
  is_blog_installed()
  wp_nonce_url()
  wp_nonce_field()
  wp_referer_field()
  wp_original_referer_field()
  wp_get_referer()
  wp_get_raw_referer()
  wp_get_original_referer()
  wp_mkdir_p()
  path_is_absolute()
  path_join()
  wp_normalize_path()
  get_temp_dir()
  wp_is_writable()
  win_is_writable()
  wp_get_upload_dir()
  wp_upload_dir()
  _wp_upload_dir()
  wp_unique_filename()
  wp_upload_bits()
  wp_ext2type()
  wp_check_filetype()
  wp_check_filetype_and_ext()
  wp_get_image_mime()
  wp_get_mime_types()
  wp_get_ext_types()
  get_allowed_mime_types()
  wp_nonce_ays()
  wp_die()
  _default_wp_die_handler()
  _xmlrpc_wp_die_handler()
  _ajax_wp_die_handler()
  _scalar_wp_die_handler()
  wp_json_encode()
  _wp_json_sanity_check()
  _wp_json_convert_string()
  _wp_json_prepare_data()
  wp_send_json()
  wp_send_json_success()
  wp_send_json_error()
  wp_check_jsonp_callback()
  _config_wp_home()
  _config_wp_siteurl()
  _delete_option_fresh_site()
  _mce_set_direction()
  smilies_init()
  wp_parse_args()
  wp_parse_id_list()
  wp_parse_slug_list()
  wp_array_slice_assoc()
  wp_is_numeric_array()
  wp_filter_object_list()
  wp_list_filter()
  wp_list_pluck()
  wp_list_sort()
  wp_maybe_load_widgets()
  wp_widgets_add_menu()
  wp_ob_end_flush_all()
  dead_db()
  absint()
  _deprecated_function()
  _deprecated_constructor()
  _deprecated_file()
  _deprecated_argument()
  _deprecated_hook()
  _doing_it_wrong()
  is_lighttpd_before_150()
  apache_mod_loaded()
  iis7_supports_permalinks()
  validate_file()
  force_ssl_admin()
  wp_guess_url()
  wp_suspend_cache_addition()
  wp_suspend_cache_invalidation()
  is_main_site()
  get_main_site_id()
  is_main_network()
  get_main_network_id()
  global_terms_enabled()
  is_site_meta_supported()
  wp_timezone_override_offset()
  _wp_timezone_choice_usort_callback()
  wp_timezone_choice()
  _cleanup_header_comment()
  wp_scheduled_delete()
  get_file_data()
  __return_true()
  __return_false()
  __return_zero()
  __return_empty_array()
  __return_null()
  __return_empty_string()
  send_nosniff_header()
  _wp_mysql_week()
  wp_find_hierarchy_loop()
  wp_find_hierarchy_loop_tortoise_hare()
  send_frame_options_header()
  wp_allowed_protocols()
  wp_debug_backtrace_summary()
  _get_non_cached_ids()
  _device_can_upload()
  wp_is_stream()
  wp_checkdate()
  wp_auth_check_load()
  wp_auth_check_html()
  wp_auth_check()
  get_tag_regex()
  _canonical_charset()
  mbstring_binary_safe_encoding()
  reset_mbstring_encoding()
  wp_validate_boolean()
  wp_delete_file()
  wp_delete_file_from_directory()
  wp_post_preview_js()
  mysql_to_rfc3339()
  wp_raise_memory_limit()
  wp_generate_uuid4()
  wp_is_uuid()
  wp_cache_get_last_changed()
  wp_site_admin_email_change_notification()
  wp_privacy_anonymize_ip()
  wp_privacy_anonymize_data()
  wp_privacy_exports_dir()
  wp_privacy_exports_url()
  wp_schedule_delete_old_privacy_export_files()
  wp_privacy_delete_old_export_files()

Functions
Functions that are not part of a class:

mysql2date( $format, $date, $translate = true )   X-Ref
Convert given date string into a different format.

$format should be either a PHP date format string, e.g. 'U' for a Unix
timestamp, or 'G' for a Unix timestamp assuming that $date is GMT.

If $translate is true then the given date and format string will
be passed to date_i18n() for translation.

return: string|int|bool Formatted date string or Unix timestamp. False if $date is empty.
param: string $format    Format of the date to return.
param: string $date      Date string to convert.
param: bool   $translate Whether the return date should be translated. Default true.

current_time( $type, $gmt = 0 )   X-Ref
Retrieve the current time based on specified type.

The 'mysql' type will return the time in the format for MySQL DATETIME field.
The 'timestamp' type will return the current timestamp.
Other strings will be interpreted as PHP date formats (e.g. 'Y-m-d').

If $gmt is set to either '1' or 'true', then both types will use GMT time.
if $gmt is false, the output is adjusted with the GMT offset in the WordPress option.

return: int|string Integer if $type is 'timestamp', string otherwise.
param: string   $type Type of time to retrieve. Accepts 'mysql', 'timestamp', or PHP date
param: int|bool $gmt  Optional. Whether to use GMT timezone. Default false.

date_i18n( $dateformatstring, $timestamp_with_offset = false, $gmt = false )   X-Ref
Retrieve the date in localized format, based on a sum of Unix timestamp and
timezone offset in seconds.

If the locale specifies the locale month and weekday, then the locale will
take over the format for the date. If it isn't, then the date format string
will be used instead.

return: string The date, translated if locale specifies it.
param: string   $dateformatstring      Format to display the date.
param: int|bool $timestamp_with_offset Optional. A sum of Unix timestamp and timezone offset in seconds.
param: bool     $gmt                   Optional. Whether to use GMT timezone. Only applies if timestamp is

wp_maybe_decline_date( $date )   X-Ref
Determines if the date should be declined.

If the locale specifies that month names require a genitive case in certain
formats (like 'j F Y'), the month name will be replaced with a correct form.

return: string The date, declined if locale specifies it.
param: string $date Formatted date string.

number_format_i18n( $number, $decimals = 0 )   X-Ref
Convert float number to format based on the locale.

return: string Converted number in string format.
param: float $number   The number to convert based on locale.
param: int   $decimals Optional. Precision of the number of decimal places. Default 0.

size_format( $bytes, $decimals = 0 )   X-Ref
Convert number of bytes largest unit bytes will fit into.

It is easier to read 1 KB than 1024 bytes and 1 MB than 1048576 bytes. Converts
number of bytes to human readable number by taking the number of that unit
that the bytes will go into it. Supports TB value.

Please note that integers in PHP are limited to 32 bits, unless they are on
64 bit architecture, then they have 64 bit size. If you need to place the
larger size then what PHP integer type will hold, then use a string. It will
be converted to a double, which should always have 64 bit length.

Technically the correct unit names for powers of 1024 are KiB, MiB etc.

return: string|false False on failure. Number string on success.
param: int|string $bytes    Number of bytes. Note max integer size for integers.
param: int        $decimals Optional. Precision of number of decimal places. Default 0.

get_weekstartend( $mysqlstring, $start_of_week = '' )   X-Ref
Get the week start and end from the datetime or date string from MySQL.

return: array Keys are 'start' and 'end'.
param: string     $mysqlstring   Date or datetime field type from MySQL.
param: int|string $start_of_week Optional. Start of the week as an integer. Default empty string.

maybe_unserialize( $original )   X-Ref
Unserialize value only if it was serialized.

return: mixed Unserialized data can be any type.
param: string $original Maybe unserialized original, if is needed.

is_serialized( $data, $strict = true )   X-Ref
Check value to find if it was serialized.

If $data is not an string, then returned value will always be false.
Serialized data is always a string.

return: bool False if not serialized and true if it was.
param: string $data   Value to check to see if was serialized.
param: bool   $strict Optional. Whether to be strict about the end of the string. Default true.

is_serialized_string( $data )   X-Ref
Check whether serialized data is of string type.

return: bool False if not a serialized string, true if it is.
param: string $data Serialized data.

maybe_serialize( $data )   X-Ref
Serialize data, if needed.

return: mixed A scalar data
param: string|array|object $data Data that might be serialized.

xmlrpc_getposttitle( $content )   X-Ref
Retrieve post title from XMLRPC XML.

If the title element is not part of the XML, then the default post title from
the $post_default_title will be used instead.

return: string Post title
param: string $content XMLRPC XML Request content

xmlrpc_getpostcategory( $content )   X-Ref
Retrieve the post category or categories from XMLRPC XML.

If the category element is not found, then the default post category will be
used. The return type then would be what $post_default_category. If the
category is found, then it will always be an array.

return: string|array List of categories or category name.
param: string $content XMLRPC XML Request content

xmlrpc_removepostdata( $content )   X-Ref
XMLRPC XML content without title and category elements.

return: string XMLRPC XML Request content without title and category elements.
param: string $content XML-RPC XML Request content.

wp_extract_urls( $content )   X-Ref
Use RegEx to extract URLs from arbitrary content.

return: array URLs found in passed string.
param: string $content Content to extract URLs from.

do_enclose( $content, $post_ID )   X-Ref
Check content for video and audio links to add as enclosures.

Will not add enclosures that have already been added and will
remove enclosures that are no longer in the post. This is called as
pingbacks and trackbacks.

param: string $content Post Content.
param: int    $post_ID Post ID.

wp_get_http_headers( $url, $deprecated = false )   X-Ref
Retrieve HTTP Headers from URL.

return: bool|string False on failure, headers on success.
param: string $url        URL to retrieve HTTP headers from.
param: bool   $deprecated Not Used.

is_new_day()   X-Ref
Determines whether the publish date of the current post in the loop is different
from the publish date of the previous post in the loop.

For more information on this and similar theme functions, check out
the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
Conditional Tags} article in the Theme Developer Handbook.

return: int 1 when new day, 0 if not a new day.

build_query( $data )   X-Ref
Build URL query based on an associative and, or indexed array.

This is a convenient function for easily building url queries. It sets the
separator to '&' and uses _http_build_query() function.

return: string URL-encoded string.
param: array $data URL-encode key/value pairs.

_http_build_query( $data, $prefix = null, $sep = null, $key = '', $urlencode = true )   X-Ref
From php.net (modified by Mark Jaquith to behave like the native PHP5 function).

return: string The query string.
param: array|object  $data       An array or object of data. Converted to array.
param: string        $prefix     Optional. Numeric index. If set, start parameter numbering with it.
param: string        $sep        Optional. Argument separator; defaults to 'arg_separator.output'.
param: string        $key        Optional. Used to prefix key name. Default empty.
param: bool          $urlencode  Optional. Whether to use urlencode() in the result. Default true.

add_query_arg()   X-Ref
Retrieves a modified URL query string.

You can rebuild the URL and append query variables to the URL query by using this function.
There are two ways to use this function; either a single key and value, or an associative array.

Using a single key and value:

add_query_arg( 'key', 'value', 'http://example.com' );

Using an associative array:

add_query_arg( array(
'key1' => 'value1',
'key2' => 'value2',
), 'http://example.com' );

Omitting the URL from either use results in the current URL being used
(the value of `$_SERVER['REQUEST_URI']`).

Values are expected to be encoded appropriately with urlencode() or rawurlencode().

Setting any query variable's value to boolean false removes the key (see remove_query_arg()).

Important: The return value of add_query_arg() is not escaped by default. Output should be
late-escaped with esc_url() or similar to help prevent vulnerability to cross-site scripting
(XSS) attacks.

return: string New URL query string (unescaped).
param: string|array $key   Either a query variable key, or an associative array of query variables.
param: string       $value Optional. Either a query variable value, or a URL to act upon.
param: string       $url   Optional. A URL to act upon.

remove_query_arg( $key, $query = false )   X-Ref
Removes an item or items from a query string.

return: string New URL query string.
param: string|array $key   Query key or keys to remove.
param: bool|string  $query Optional. When false uses the current URL. Default false.

wp_removable_query_args()   X-Ref
Returns an array of single-use query variable names that can be removed from a URL.

return: array An array of parameters to remove from the URL.

add_magic_quotes( $array )   X-Ref
Walks the array while sanitizing the contents.

return: array Sanitized $array.
param: array $array Array to walk while sanitizing contents.

wp_remote_fopen( $uri )   X-Ref
HTTP request for URI to retrieve content.

return: false|string HTTP content. False on failure.
param: string $uri URI/URL of web page to retrieve.

wp( $query_vars = '' )   X-Ref
Set up the WordPress query.

param: string|array $query_vars Default WP_Query arguments.

get_status_header_desc( $code )   X-Ref
Retrieve the description for the HTTP status.

return: string Empty string if not found, or description if found.
param: int $code HTTP status code.

status_header( $code, $description = '' )   X-Ref
Set HTTP status header.

param: int    $code        HTTP status code.
param: string $description Optional. A custom description for the HTTP status.

wp_get_nocache_headers()   X-Ref
Get the header information to prevent caching.

The several different headers cover the different ways cache prevention
is handled by different browsers

return: array The associative array of header names and field values.

nocache_headers()   X-Ref
Set the headers to prevent caching for the different browsers.

Different browsers support different nocache headers, so several
headers must be sent so that all of them get the point that no
caching should occur.


cache_javascript_headers()   X-Ref
Set the headers for caching for 10 days with JavaScript content type.


get_num_queries()   X-Ref
Retrieve the number of database queries during the WordPress execution.

return: int Number of database queries.

bool_from_yn( $yn )   X-Ref
Whether input is yes or no.

Must be 'y' to be true.

return: bool True if yes, false on anything else.
param: string $yn Character string containing either 'y' (yes) or 'n' (no).

do_feed()   X-Ref
Load the feed template from the use of an action hook.

If the feed action does not have a hook, then the function will die with a
message telling the visitor that the feed is not valid.

It is better to only have one hook for each feed.


do_feed_rdf()   X-Ref
Load the RDF RSS 0.91 Feed template.


do_feed_rss()   X-Ref
Load the RSS 1.0 Feed Template.


do_feed_rss2( $for_comments )   X-Ref
Load either the RSS2 comment feed or the RSS2 posts feed.

param: bool $for_comments True for the comment feed, false for normal feed.

do_feed_atom( $for_comments )   X-Ref
Load either Atom comment feed or Atom posts feed.

param: bool $for_comments True for the comment feed, false for normal feed.

do_robots()   X-Ref
Display the robots.txt file content.

The echo content should be with usage of the permalinks or for creating the
robots.txt file.


is_blog_installed()   X-Ref
Determines whether WordPress is already installed.

The cache will be checked first. If you have a cache plugin, which saves
the cache values, then this will work. If you use the default WordPress
cache, and the database goes away, then you might have problems.

Checks for the 'siteurl' option for whether WordPress is installed.

For more information on this and similar theme functions, check out
the {@link https://developer.wordpress.org/themes/basics/conditional-tags/
Conditional Tags} article in the Theme Developer Handbook.

return: bool Whether the site is already installed.

wp_nonce_url( $actionurl, $action = -1, $name = '_wpnonce' )   X-Ref
Retrieve URL with nonce added to URL query.

return: string Escaped URL with nonce action added.
param: string     $actionurl URL to add nonce action.
param: int|string $action    Optional. Nonce action name. Default -1.
param: string     $name      Optional. Nonce name. Default '_wpnonce'.

wp_nonce_field( $action = -1, $name = '_wpnonce', $referer = true, $echo = true )   X-Ref
Retrieve or display nonce hidden field for forms.

The nonce field is used to validate that the contents of the form came from
the location on the current site and not somewhere else. The nonce does not
offer absolute protection, but should protect against most cases. It is very
important to use nonce field in forms.

The $action and $name are optional, but if you want to have better security,
it is strongly suggested to set those two parameters. It is easier to just
call the function without any parameters, because validation of the nonce
doesn't require any parameters, but since crackers know what the default is
it won't be difficult for them to find a way around your nonce and cause
damage.

The input name will be whatever $name value you gave. The input value will be
the nonce creation value.

return: string Nonce field HTML markup.
param: int|string $action  Optional. Action name. Default -1.
param: string     $name    Optional. Nonce name. Default '_wpnonce'.
param: bool       $referer Optional. Whether to set the referer field for validation. Default true.
param: bool       $echo    Optional. Whether to display or return hidden form field. Default true.

wp_referer_field( $echo = true )   X-Ref
Retrieve or display referer hidden field for forms.

The referer link is the current Request URI from the server super global. The
input name is '_wp_http_referer', in case you wanted to check manually.

return: string Referer field HTML markup.
param: bool $echo Optional. Whether to echo or return the referer field. Default true.

wp_original_referer_field( $echo = true, $jump_back_to = 'current' )   X-Ref
Retrieve or display original referer hidden field for forms.

The input name is '_wp_original_http_referer' and will be either the same
value of wp_referer_field(), if that was posted already or it will be the
current page, if it doesn't exist.

return: string Original referer field.
param: bool   $echo         Optional. Whether to echo the original http referer. Default true.
param: string $jump_back_to Optional. Can be 'previous' or page you want to jump back to.

wp_get_referer()   X-Ref
Retrieve referer from '_wp_http_referer' or HTTP referer.

If it's the same as the current request URL, will return false.

return: false|string False on failure. Referer URL on success.

wp_get_raw_referer()   X-Ref
Retrieves unvalidated referer from '_wp_http_referer' or HTTP referer.

Do not use for redirects, use wp_get_referer() instead.

return: string|false Referer URL on success, false on failure.

wp_get_original_referer()   X-Ref
Retrieve original referer that was posted, if it exists.

return: string|false False if no original referer or original referer if set.

wp_mkdir_p( $target )   X-Ref
Recursive directory creation based on full path.

Will attempt to set permissions on folders.

return: bool Whether the path was created. True if path already exists.
param: string $target Full path to attempt to create.

path_is_absolute( $path )   X-Ref
Test if a given filesystem path is absolute.

For example, '/foo/bar', or 'c:\windows'.

return: bool True if path is absolute, false is not absolute.
param: string $path File path.

path_join( $base, $path )   X-Ref
Join two filesystem paths together.

For example, 'give me $path relative to $base'. If the $path is absolute,
then it the full path is returned.

return: string The path with the base or absolute path.
param: string $base Base path.
param: string $path Path relative to $base.

wp_normalize_path( $path )   X-Ref
Normalize a filesystem path.

On windows systems, replaces backslashes with forward slashes
and forces upper-case drive letters.
Allows for two leading slashes for Windows network shares, but
ensures that all other duplicate slashes are reduced to a single.

return: string Normalized path.
param: string $path Path to normalize.

get_temp_dir()   X-Ref
Determine a writable directory for temporary files.

Function's preference is the return value of sys_get_temp_dir(),
followed by your PHP temporary upload directory, followed by WP_CONTENT_DIR,
before finally defaulting to /tmp/

In the event that this function does not find a writable location,
It may be overridden by the WP_TEMP_DIR constant in your wp-config.php file.

return: string Writable temporary directory.

wp_is_writable( $path )   X-Ref
Determine if a directory is writable.

This function is used to work around certain ACL issues in PHP primarily
affecting Windows Servers.

return: bool Whether the path is writable.
param: string $path Path to check for write-ability.

win_is_writable( $path )   X-Ref
Workaround for Windows bug in is_writable() function

PHP has issues with Windows ACL's for determine if a
directory is writable or not, this works around them by
checking the ability to open files rather than relying
upon PHP to interprate the OS ACL.

return: bool Whether the path is writable.
param: string $path Windows path to check for write-ability.

wp_get_upload_dir()   X-Ref
Retrieves uploads directory information.

Same as wp_upload_dir() but "light weight" as it doesn't attempt to create the uploads directory.
Intended for use in themes, when only 'basedir' and 'baseurl' are needed, generally in all cases
when not uploading files.

return: array See wp_upload_dir() for description.

wp_upload_dir( $time = null, $create_dir = true, $refresh_cache = false )   X-Ref
Get an array containing the current upload directory's path and url.

Checks the 'upload_path' option, which should be from the web root folder,
and if it isn't empty it will be used. If it is empty, then the path will be
'WP_CONTENT_DIR/uploads'. If the 'UPLOADS' constant is defined, then it will
override the 'upload_path' option and 'WP_CONTENT_DIR/uploads' path.

The upload URL path is set either by the 'upload_url_path' option or by using
the 'WP_CONTENT_URL' constant and appending '/uploads' to the path.

If the 'uploads_use_yearmonth_folders' is set to true (checkbox if checked in
the administration settings panel), then the time will be used. The format
will be year first and then month.

If the path couldn't be created, then an error will be returned with the key
'error' containing the error message. The error suggests that the parent
directory is not writable by the server.

On success, the returned array will have many indices:
'path' - base directory and sub directory or full path to upload directory.
'url' - base url and sub directory or absolute URL to upload directory.
'subdir' - sub directory if uploads use year/month folders option is on.
'basedir' - path without subdir.
'baseurl' - URL path without subdir.
'error' - false or error message.

return: array See above for description.
param: string $time Optional. Time formatted in 'yyyy/mm'. Default null.
param: bool   $create_dir Optional. Whether to check and create the uploads directory.
param: bool   $refresh_cache Optional. Whether to refresh the cache. Default false.

_wp_upload_dir( $time = null )   X-Ref
A non-filtered, non-cached version of wp_upload_dir() that doesn't check the path.

return: array See wp_upload_dir()
param: string $time Optional. Time formatted in 'yyyy/mm'. Default null.

wp_unique_filename( $dir, $filename, $unique_filename_callback = null )   X-Ref
Get a filename that is sanitized and unique for the given directory.

If the filename is not unique, then a number will be added to the filename
before the extension, and will continue adding numbers until the filename is
unique.

The callback is passed three parameters, the first one is the directory, the
second is the filename, and the third is the extension.

return: string New filename, if given wasn't unique.
param: string   $dir                      Directory.
param: string   $filename                 File name.
param: callable $unique_filename_callback Callback. Default null.

wp_upload_bits( $name, $deprecated, $bits, $time = null )   X-Ref
Create a file in the upload folder with given content.

If there is an error, then the key 'error' will exist with the error message.
If success, then the key 'file' will have the unique file path, the 'url' key
will have the link to the new file. and the 'error' key will be set to false.

This function will not move an uploaded file to the upload folder. It will
create a new file with the content in $bits parameter. If you move the upload
file, read the content of the uploaded file, and then you can give the
filename and content to this function, which will add it to the upload
folder.

The permissions will be set on the new file automatically by this function.

return: array
param: string       $name       Filename.
param: null|string  $deprecated Never used. Set to null.
param: mixed        $bits       File content
param: string       $time       Optional. Time formatted in 'yyyy/mm'. Default null.

wp_ext2type( $ext )   X-Ref
Retrieve the file type based on the extension name.

return: string|void The file type, example: audio, video, document, spreadsheet, etc.
param: string $ext The extension to search.

wp_check_filetype( $filename, $mimes = null )   X-Ref
Retrieve the file type from the file name.

You can optionally define the mime array, if needed.

return: array Values with extension first and mime type.
param: string $filename File name or path.
param: array  $mimes    Optional. Key is the file extension with value as the mime type.

wp_check_filetype_and_ext( $file, $filename, $mimes = null )   X-Ref
Attempt to determine the real file type of a file.

If unable to, the file name extension will be used to determine type.

If it's determined that the extension does not match the file's real type,
then the "proper_filename" value will be set with a proper filename and extension.

Currently this function only supports renaming images validated via wp_get_image_mime().

return: array Values for the extension, MIME, and either a corrected filename or false
param: string $file     Full path to the file.
param: string $filename The name of the file (may differ from $file due to $file being
param: array   $mimes   Optional. Key is the file extension with value as the mime type.

wp_get_image_mime( $file )   X-Ref
Returns the real mime type of an image file.

This depends on exif_imagetype() or getimagesize() to determine real mime types.

return: string|false The actual mime type or false if the type cannot be determined.
param: string $file Full path to the file.

wp_get_mime_types()   X-Ref
Retrieve list of mime types and file extensions.

return: array Array of mime types keyed by the file extension regex corresponding to those types.

wp_get_ext_types()   X-Ref
Retrieves the list of common file extensions and their types.

return: array Array of file extensions types keyed by the type of file.

get_allowed_mime_types( $user = null )   X-Ref
Retrieve list of allowed mime types and file extensions.

return: array Array of mime types keyed by the file extension regex corresponding
param: int|WP_User $user Optional. User to check. Defaults to current user.

wp_nonce_ays( $action )   X-Ref
Display "Are You Sure" message to confirm the action being taken.

If the action has the nonce explain message, then it will be displayed
along with the "Are you sure?" message.

param: string $action The nonce action.

wp_die( $message = '', $title = '', $args = array()   X-Ref
Kill WordPress execution and display HTML message with error message.

This function complements the `die()` PHP function. The difference is that
HTML will be displayed to the user. It is recommended to use this function
only when the execution should not continue any further. It is not recommended
to call this function very often, and try to handle as many errors as possible
silently or more gracefully.

As a shorthand, the desired HTTP response code may be passed as an integer to
the `$title` parameter (the default title would apply) or the `$args` parameter.

param: string|WP_Error  $message Optional. Error message. If this is a WP_Error object,
param: string|int       $title   Optional. Error title. If `$message` is a `WP_Error` object,
param: string|array|int $args {

_default_wp_die_handler( $message, $title = '', $args = array()   X-Ref
Kills WordPress execution and display HTML message with error message.

This is the default handler for wp_die if you want a custom one for your
site then you can overload using the {@see 'wp_die_handler'} filter in wp_die().

param: string|WP_Error $message Error message or WP_Error object.
param: string          $title   Optional. Error title. Default empty.
param: string|array    $args    Optional. Arguments to control behavior. Default empty array.

_xmlrpc_wp_die_handler( $message, $title = '', $args = array()   X-Ref
Kill WordPress execution and display XML message with error message.

This is the handler for wp_die when processing XMLRPC requests.

param: string       $message Error message.
param: string       $title   Optional. Error title. Default empty.
param: string|array $args    Optional. Arguments to control behavior. Default empty array.

_ajax_wp_die_handler( $message, $title = '', $args = array()   X-Ref
Kill WordPress ajax execution.

This is the handler for wp_die when processing Ajax requests.

param: string       $message Error message.
param: string       $title   Optional. Error title (unused). Default empty.
param: string|array $args    Optional. Arguments to control behavior. Default empty array.

_scalar_wp_die_handler( $message = '' )   X-Ref
Kill WordPress execution.

This is the handler for wp_die when processing APP requests.

param: string $message Optional. Response to print. Default empty.

wp_json_encode( $data, $options = 0, $depth = 512 )   X-Ref
Encode a variable into JSON, with some sanity checks.

return: string|false The JSON encoded string, or false if it cannot be encoded.
param: mixed $data    Variable (usually an array or object) to encode as JSON.
param: int   $options Optional. Options to be passed to json_encode(). Default 0.
param: int   $depth   Optional. Maximum depth to walk through $data. Must be

_wp_json_sanity_check( $data, $depth )   X-Ref
Perform sanity checks on data that shall be encoded to JSON.

return: mixed The sanitized data that shall be encoded to JSON.
param: mixed $data  Variable (usually an array or object) to encode as JSON.
param: int   $depth Maximum depth to walk through $data. Must be greater than 0.

_wp_json_convert_string( $string )   X-Ref
Convert a string to UTF-8, so that it can be safely encoded to JSON.

return: string The checked string.
param: string $string The string which is to be converted.

_wp_json_prepare_data( $data )   X-Ref
Prepares response data to be serialized to JSON.

This supports the JsonSerializable interface for PHP 5.2-5.3 as well.

return: bool|int|float|null|string|array Data ready for `json_encode()`.
param: mixed $data Native representation.

wp_send_json( $response, $status_code = null )   X-Ref
Send a JSON response back to an Ajax request.

param: mixed $response    Variable (usually an array or object) to encode as JSON,
param: int   $status_code The HTTP status code to output.

wp_send_json_success( $data = null, $status_code = null )   X-Ref
Send a JSON response back to an Ajax request, indicating success.

param: mixed $data        Data to encode as JSON, then print and die.
param: int   $status_code The HTTP status code to output.

wp_send_json_error( $data = null, $status_code = null )   X-Ref
Send a JSON response back to an Ajax request, indicating failure.

If the `$data` parameter is a WP_Error object, the errors
within the object are processed and output as an array of error
codes and corresponding messages. All other types are output
without further processing.

param: mixed $data        Data to encode as JSON, then print and die.
param: int   $status_code The HTTP status code to output.

wp_check_jsonp_callback( $callback )   X-Ref
Checks that a JSONP callback is a valid JavaScript callback.

Only allows alphanumeric characters and the dot character in callback
function names. This helps to mitigate XSS attacks caused by directly
outputting user input.

return: bool True if valid callback, otherwise false.
param: string $callback Supplied JSONP callback function.

_config_wp_home( $url = '' )   X-Ref
Retrieve the WordPress home page URL.

If the constant named 'WP_HOME' exists, then it will be used and returned
by the function. This can be used to counter the redirection on your local
development environment.

return: string Homepage location.
param: string $url URL for the home location.

_config_wp_siteurl( $url = '' )   X-Ref
Retrieve the WordPress site URL.

If the constant named 'WP_SITEURL' is defined, then the value in that
constant will always be returned. This can be used for debugging a site
on your localhost while not having to change the database to your URL.

return: string The WordPress Site URL.
param: string $url URL to set the WordPress site location.

_delete_option_fresh_site()   X-Ref
Delete the fresh site option.


_mce_set_direction( $mce_init )   X-Ref
Set the localized direction for MCE plugin.

Will only set the direction to 'rtl', if the WordPress locale has
the text direction set to 'rtl'.

Fills in the 'directionality' setting, enables the 'directionality'
plugin, and adds the 'ltr' button to 'toolbar1', formerly
'theme_advanced_buttons1' array keys. These keys are then returned
in the $mce_init (TinyMCE settings) array.

return: array Direction set for 'rtl', if needed by locale.
param: array $mce_init MCE settings array.

smilies_init()   X-Ref
Convert smiley code to the icon graphic file equivalent.

You can turn off smilies, by going to the write setting screen and unchecking
the box, or by setting 'use_smilies' option to false or removing the option.

Plugins may override the default smiley list by setting the $wpsmiliestrans
to an array, with the key the code the blogger types in and the value the
image file.

The $wp_smiliessearch global is for the regular expression and is set each
time the function is called.

The full list of smilies can be found in the function and won't be listed in
the description. Probably should create a Codex page for it, so that it is
available.


wp_parse_args( $args, $defaults = '' )   X-Ref
Merge user defined arguments into defaults array.

This function is used throughout WordPress to allow for both string or array
to be merged into another array.

return: array Merged user defined values with defaults.
param: string|array|object $args     Value to merge with $defaults.
param: array               $defaults Optional. Array that serves as the defaults. Default empty.

wp_parse_id_list( $list )   X-Ref
Clean up an array, comma- or space-separated list of IDs.

return: array Sanitized array of IDs.
param: array|string $list List of ids.

wp_parse_slug_list( $list )   X-Ref
Clean up an array, comma- or space-separated list of slugs.

return: array Sanitized array of slugs.
param: array|string $list List of slugs.

wp_array_slice_assoc( $array, $keys )   X-Ref
Extract a slice of an array, given a list of keys.

return: array The array slice.
param: array $array The original array.
param: array $keys  The list of keys.

wp_is_numeric_array( $data )   X-Ref
Determines if the variable is a numeric-indexed array.

return: bool Whether the variable is a list.
param: mixed $data Variable to check.

wp_filter_object_list( $list, $args = array()   X-Ref
Filters a list of objects, based on a set of key => value arguments.

return: array A list of objects or object fields.
param: array       $list     An array of objects to filter
param: array       $args     Optional. An array of key => value arguments to match
param: string      $operator Optional. The logical operation to perform. 'or' means
param: bool|string $field    A field from the object to place instead of the entire object.

wp_list_filter( $list, $args = array()   X-Ref
Filters a list of objects, based on a set of key => value arguments.

return: array Array of found values.
param: array  $list     An array of objects to filter.
param: array  $args     Optional. An array of key => value arguments to match
param: string $operator Optional. The logical operation to perform. 'AND' means

wp_list_pluck( $list, $field, $index_key = null )   X-Ref
Pluck a certain field out of each object in a list.

This has the same functionality and prototype of
array_column() (PHP 5.5) but also supports objects.

return: array Array of found values. If `$index_key` is set, an array of found values with keys
param: array      $list      List of objects or arrays
param: int|string $field     Field from the object to place instead of the entire object
param: int|string $index_key Optional. Field from the object to use as keys for the new array.

wp_list_sort( $list, $orderby = array()   X-Ref
Sorts a list of objects, based on one or more orderby arguments.

return: array The sorted array.
param: array        $list          An array of objects to filter.
param: string|array $orderby       Optional. Either the field name to order by or an array
param: string       $order         Optional. Either 'ASC' or 'DESC'. Only used if $orderby
param: bool         $preserve_keys Optional. Whether to preserve keys. Default false.

wp_maybe_load_widgets()   X-Ref
Determines if Widgets library should be loaded.

Checks to make sure that the widgets library hasn't already been loaded.
If it hasn't, then it will load the widgets library and run an action hook.


wp_widgets_add_menu()   X-Ref
Append the Widgets menu to the themes main menu.


wp_ob_end_flush_all()   X-Ref
Flush all output buffers for PHP 5.2.

Make sure all output buffers are flushed before our singletons are destroyed.


dead_db()   X-Ref
Load custom DB error or display WordPress DB error.

If a file exists in the wp-content directory named db-error.php, then it will
be loaded instead of displaying the WordPress DB error. If it is not found,
then the WordPress DB error will be displayed instead.

The WordPress DB error sets the HTTP status header to 500 to try to prevent
search engines from caching the message. Custom DB messages should do the
same.

This function was backported to WordPress 2.3.2, but originally was added
in WordPress 2.5.0.


absint( $maybeint )   X-Ref
Convert a value to non-negative integer.

return: int A non-negative integer.
param: mixed $maybeint Data you wish to have converted to a non-negative integer.

_deprecated_function( $function, $version, $replacement = null )   X-Ref
Mark a function as deprecated and inform when it has been used.

There is a {@see 'hook deprecated_function_run'} that will be called that can be used
to get the backtrace up to what file and function called the deprecated
function.

The current behavior is to trigger a user error if `WP_DEBUG` is true.

This function is to be used in every function that is deprecated.

param: string $function    The function that was called.
param: string $version     The version of WordPress that deprecated the function.
param: string $replacement Optional. The function that should have been called. Default null.

_deprecated_constructor( $class, $version, $parent_class = '' )   X-Ref
Marks a constructor as deprecated and informs when it has been used.

Similar to _deprecated_function(), but with different strings. Used to
remove PHP4 style constructors.

The current behavior is to trigger a user error if `WP_DEBUG` is true.

This function is to be used in every PHP4 style constructor method that is deprecated.

param: string $class        The class containing the deprecated constructor.
param: string $version      The version of WordPress that deprecated the function.
param: string $parent_class Optional. The parent class calling the deprecated constructor.

_deprecated_file( $file, $version, $replacement = null, $message = '' )   X-Ref
Mark a file as deprecated and inform when it has been used.

There is a hook {@see 'deprecated_file_included'} that will be called that can be used
to get the backtrace up to what file and function included the deprecated
file.

The current behavior is to trigger a user error if `WP_DEBUG` is true.

This function is to be used in every file that is deprecated.

param: string $file        The file that was included.
param: string $version     The version of WordPress that deprecated the file.
param: string $replacement Optional. The file that should have been included based on ABSPATH.
param: string $message     Optional. A message regarding the change. Default empty.

_deprecated_argument( $function, $version, $message = null )   X-Ref
Mark a function argument as deprecated and inform when it has been used.

This function is to be used whenever a deprecated function argument is used.
Before this function is called, the argument must be checked for whether it was
used by comparing it to its default value or evaluating whether it is empty.
For example:

if ( ! empty( $deprecated ) ) {
_deprecated_argument( __FUNCTION__, '3.0.0' );
}

There is a hook deprecated_argument_run that will be called that can be used
to get the backtrace up to what file and function used the deprecated
argument.

The current behavior is to trigger a user error if WP_DEBUG is true.

param: string $function The function that was called.
param: string $version  The version of WordPress that deprecated the argument used.
param: string $message  Optional. A message regarding the change. Default null.

_deprecated_hook( $hook, $version, $replacement = null, $message = null )   X-Ref
Marks a deprecated action or filter hook as deprecated and throws a notice.

Use the {@see 'deprecated_hook_run'} action to get the backtrace describing where
the deprecated hook was called.

Default behavior is to trigger a user error if `WP_DEBUG` is true.

This function is called by the do_action_deprecated() and apply_filters_deprecated()
functions, and so generally does not need to be called directly.

param: string $hook        The hook that was used.
param: string $version     The version of WordPress that deprecated the hook.
param: string $replacement Optional. The hook that should have been used.
param: string $message     Optional. A message regarding the change.

_doing_it_wrong( $function, $message, $version )   X-Ref
Mark something as being incorrectly called.

There is a hook {@see 'doing_it_wrong_run'} that will be called that can be used
to get the backtrace up to what file and function called the deprecated
function.

The current behavior is to trigger a user error if `WP_DEBUG` is true.

param: string $function The function that was called.
param: string $message  A message explaining what has been done incorrectly.
param: string $version  The version of WordPress where the message was added.

is_lighttpd_before_150()   X-Ref
Is the server running earlier than 1.5.0 version of lighttpd?

return: bool Whether the server is running lighttpd < 1.5.0.

apache_mod_loaded( $mod, $default = false )   X-Ref
Does the specified module exist in the Apache config?

return: bool Whether the specified module is loaded.
param: string $mod     The module, e.g. mod_rewrite.
param: bool   $default Optional. The default return value if the module is not found. Default false.

iis7_supports_permalinks()   X-Ref
Check if IIS 7+ supports pretty permalinks.

return: bool Whether IIS7 supports permalinks.

validate_file( $file, $allowed_files = array()   X-Ref
Validates a file name and path against an allowed set of rules.

A return value of `1` means the file path contains directory traversal.

A return value of `2` means the file path contains a Windows drive path.

A return value of `3` means the file is not in the allowed files list.

return: int 0 means nothing is wrong, greater than 0 means something was wrong.
param: string $file          File path.
param: array  $allowed_files Optional. List of allowed files.

force_ssl_admin( $force = null )   X-Ref
Whether to force SSL used for the Administration Screens.

return: bool True if forced, false if not forced.
param: string|bool $force Optional. Whether to force SSL in admin screens. Default null.

wp_guess_url()   X-Ref
Guess the URL for the site.

Will remove wp-admin links to retrieve only return URLs not in the wp-admin
directory.

return: string The guessed URL.

wp_suspend_cache_addition( $suspend = null )   X-Ref
Temporarily suspend cache additions.

Stops more data being added to the cache, but still allows cache retrieval.
This is useful for actions, such as imports, when a lot of data would otherwise
be almost uselessly added to the cache.

Suspension lasts for a single page load at most. Remember to call this
function again if you wish to re-enable cache adds earlier.

return: bool The current suspend setting
param: bool $suspend Optional. Suspends additions if true, re-enables them if false.

wp_suspend_cache_invalidation( $suspend = true )   X-Ref
Suspend cache invalidation.

Turns cache invalidation on and off. Useful during imports where you don't want to do
invalidations every time a post is inserted. Callers must be sure that what they are
doing won't lead to an inconsistent cache when invalidation is suspended.

return: bool The current suspend setting.
param: bool $suspend Optional. Whether to suspend or enable cache invalidation. Default true.

is_main_site( $site_id = null, $network_id = null )   X-Ref
Determine whether a site is the main site of the current network.

return: bool True if $site_id is the main site of the network, or if not
param: int $site_id    Optional. Site ID to test. Defaults to current site.
param: int $network_id Optional. Network ID of the network to check for.

get_main_site_id( $network_id = null )   X-Ref
Gets the main site ID.

return: int The ID of the main site.
param: int $network_id Optional. The ID of the network for which to get the main site.

is_main_network( $network_id = null )   X-Ref
Determine whether a network is the main network of the Multisite installation.

return: bool True if $network_id is the main network, or if not running Multisite.
param: int $network_id Optional. Network ID to test. Defaults to current network.

get_main_network_id()   X-Ref
Get the main network ID.

return: int The ID of the main network.

global_terms_enabled()   X-Ref
Determine whether global terms are enabled.

return: bool True if multisite and global terms enabled.

is_site_meta_supported()   X-Ref
Determines whether site meta is enabled.

This function checks whether the 'blogmeta' database table exists. The result is saved as
a setting for the main network, making it essentially a global setting. Subsequent requests
will refer to this setting instead of running the query.

return: bool True if site meta is supported, false otherwise.

wp_timezone_override_offset()   X-Ref
gmt_offset modification for smart timezone handling.

Overrides the gmt_offset option if we have a timezone_string available.

return: float|false Timezone GMT offset, false otherwise.

_wp_timezone_choice_usort_callback( $a, $b )   X-Ref
Sort-helper for timezones.

return: int
param: array $a
param: array $b

wp_timezone_choice( $selected_zone, $locale = null )   X-Ref
Gives a nicely-formatted list of timezone strings.

return: string
param: string $selected_zone Selected timezone.
param: string $locale        Optional. Locale to load the timezones in. Default current site locale.

_cleanup_header_comment( $str )   X-Ref
Strip close comment and close php tags from file headers used by WP.

return: string
param: string $str Header comment to clean up.

wp_scheduled_delete()   X-Ref
Permanently delete comments or posts of any type that have held a status
of 'trash' for the number of days defined in EMPTY_TRASH_DAYS.

The default value of `EMPTY_TRASH_DAYS` is 30 (days).


get_file_data( $file, $default_headers, $context = '' )   X-Ref
Retrieve metadata from a file.

Searches for metadata in the first 8kiB of a file, such as a plugin or theme.
Each piece of metadata must be on its own line. Fields can not span multiple
lines, the value will get cut at the end of the first line.

If the file data is not within that first 8kiB, then the author should correct
their plugin file and move the data headers to the top.

return: array Array of file headers in `HeaderKey => Header Value` format.
param: string $file            Absolute path to the file.
param: array  $default_headers List of headers, in the format `array('HeaderKey' => 'Header Name')`.
param: string $context         Optional. If specified adds filter hook {@see 'extra_$context_headers'}.

__return_true()   X-Ref
Returns true.

Useful for returning true to filters easily.

return: true True.

__return_false()   X-Ref
Returns false.

Useful for returning false to filters easily.

return: false False.

__return_zero()   X-Ref
Returns 0.

Useful for returning 0 to filters easily.

return: int 0.

__return_empty_array()   X-Ref
Returns an empty array.

Useful for returning an empty array to filters easily.

return: array Empty array.

__return_null()   X-Ref
Returns null.

Useful for returning null to filters easily.

return: null Null value.

__return_empty_string()   X-Ref
Returns an empty string.

Useful for returning an empty string to filters easily.

return: string Empty string.

send_nosniff_header()   X-Ref
Send a HTTP header to disable content type sniffing in browsers which support it.


_wp_mysql_week( $column )   X-Ref
Return a MySQL expression for selecting the week number based on the start_of_week option.

return: string SQL clause.
param: string $column Database column.

wp_find_hierarchy_loop( $callback, $start, $start_parent, $callback_args = array()   X-Ref
Find hierarchy loops using a callback function that maps object IDs to parent IDs.

return: array IDs of all members of loop.
param: callable $callback      Function that accepts ( ID, $callback_args ) and outputs parent_ID.
param: int      $start         The ID to start the loop check at.
param: int      $start_parent  The parent_ID of $start to use instead of calling $callback( $start ).
param: array    $callback_args Optional. Additional arguments to send to $callback.

wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override = array()   X-Ref
Use the "The Tortoise and the Hare" algorithm to detect loops.

For every step of the algorithm, the hare takes two steps and the tortoise one.
If the hare ever laps the tortoise, there must be a loop.

return: mixed Scalar ID of some arbitrary member of the loop, or array of IDs of all members of loop if
param: callable $callback      Function that accepts ( ID, callback_arg, ... ) and outputs parent_ID.
param: int      $start         The ID to start the loop check at.
param: array    $override      Optional. An array of ( ID => parent_ID, ... ) to use instead of $callback.
param: array    $callback_args Optional. Additional arguments to send to $callback. Default empty array.
param: bool     $_return_loop  Optional. Return loop members or just detect presence of loop? Only set

send_frame_options_header()   X-Ref
Send a HTTP header to limit rendering of pages to same origin iframes.


wp_allowed_protocols()   X-Ref
Retrieve a list of protocols to allow in HTML attributes.

return: string[] Array of allowed protocols. Defaults to an array containing 'http', 'https',

wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pretty = true )   X-Ref
Return a comma-separated string of functions that have been called to get
to the current point in code.

return: string|array Either a string containing a reversed comma separated trace or an array
param: string $ignore_class Optional. A class to ignore all function calls within - useful
param: int    $skip_frames  Optional. A number of stack frames to skip - useful for unwinding
param: bool   $pretty       Optional. Whether or not you want a comma separated string or raw

_get_non_cached_ids( $object_ids, $cache_key )   X-Ref
Retrieve IDs that are not already present in the cache.

return: int[] Array of IDs not present in the cache.
param: int[]  $object_ids Array of IDs.
param: string $cache_key  The cache bucket to check against.

_device_can_upload()   X-Ref
Test if the current device has the capability to upload files.

return: bool Whether the device is able to upload files.

wp_is_stream( $path )   X-Ref
Test if a given path is a stream URL

return: bool True if the path is a stream URL.
param: string $path The resource path or URL.

wp_checkdate( $month, $day, $year, $source_date )   X-Ref
Test if the supplied date is valid for the Gregorian calendar.

return: bool True if valid date, false if not valid date.
param: int    $month       Month number.
param: int    $day         Day number.
param: int    $year        Year number.
param: string $source_date The date to filter.

wp_auth_check_load()   X-Ref
Load the auth check for monitoring whether the user is still logged in.

Can be disabled with remove_action( 'admin_enqueue_scripts', 'wp_auth_check_load' );

This is disabled for certain screens where a login screen could cause an
inconvenient interruption. A filter called {@see 'wp_auth_check_load'} can be used
for fine-grained control.


wp_auth_check_html()   X-Ref
Output the HTML that shows the wp-login dialog when the user is no longer logged in.


wp_auth_check( $response )   X-Ref
Check whether a user is still logged in, for the heartbeat.

Send a result that shows a log-in box if the user is no longer logged in,
or if their cookie is within the grace period.

return: array $response The Heartbeat response with 'wp-auth-check' value set.
param: array $response  The Heartbeat response.

get_tag_regex( $tag )   X-Ref
Return RegEx body to liberally match an opening HTML tag.

Matches an opening HTML tag that:
1. Is self-closing or
2. Has no body but has a closing tag of the same name or
3. Contains a body and a closing tag of the same name

Note: this RegEx does not balance inner tags and does not attempt
to produce valid HTML

return: string Tag RegEx.
param: string $tag An HTML tag name. Example: 'video'.

_canonical_charset( $charset )   X-Ref
Retrieve a canonical form of the provided charset appropriate for passing to PHP
functions such as htmlspecialchars() and charset html attributes.

return: string The canonical form of the charset.
param: string $charset A charset name.

mbstring_binary_safe_encoding( $reset = false )   X-Ref
Set the mbstring internal encoding to a binary safe encoding when func_overload
is enabled.

When mbstring.func_overload is in use for multi-byte encodings, the results from
strlen() and similar functions respect the utf8 characters, causing binary data
to return incorrect lengths.

This function overrides the mbstring encoding to a binary-safe encoding, and
resets it to the users expected encoding afterwards through the
`reset_mbstring_encoding` function.

It is safe to recursively call this function, however each
`mbstring_binary_safe_encoding()` call must be followed up with an equal number
of `reset_mbstring_encoding()` calls.

param: bool $reset Optional. Whether to reset the encoding back to a previously-set encoding.

reset_mbstring_encoding()   X-Ref
Reset the mbstring internal encoding to a users previously set encoding.


wp_validate_boolean( $var )   X-Ref
Filter/validate a variable as a boolean.

Alternative to `filter_var( $var, FILTER_VALIDATE_BOOLEAN )`.

return: bool Whether the value is validated.
param: mixed $var Boolean value to validate.

wp_delete_file( $file )   X-Ref
Delete a file

param: string $file The path to the file to delete.

wp_delete_file_from_directory( $file, $directory )   X-Ref
Deletes a file if its path is within the given directory.

return: bool True on success, false on failure.
param: string $file      Absolute path to the file to delete.
param: string $directory Absolute path to a directory.

wp_post_preview_js()   X-Ref
Outputs a small JS snippet on preview tabs/windows to remove `window.name` on unload.

This prevents reusing the same tab for a preview when the user has navigated away.


mysql_to_rfc3339( $date_string )   X-Ref
Parses and formats a MySQL datetime (Y-m-d H:i:s) for ISO8601 (Y-m-d\TH:i:s).

Explicitly strips timezones, as datetimes are not saved with any timezone
information. Including any information on the offset could be misleading.

Despite historical function name, the output does not conform to RFC3339 format,
which must contain timezone.

return: string Date formatted for ISO8601 without time zone.
param: string $date_string Date string to parse and format.

wp_raise_memory_limit( $context = 'admin' )   X-Ref
Attempts to raise the PHP memory limit for memory intensive processes.

Only allows raising the existing limit and prevents lowering it.

return: bool|int|string The limit that was set or false on failure.
param: string $context Optional. Context in which the function is called. Accepts either 'admin',

wp_generate_uuid4()   X-Ref
Generate a random UUID (version 4).

return: string UUID.

wp_is_uuid( $uuid, $version = null )   X-Ref
Validates that a UUID is valid.

return: bool The string is a valid UUID or false on failure.
param: mixed $uuid    UUID to check.
param: int   $version Specify which version of UUID to check against. Default is none, to accept any UUID version. Otherwise, only version allowed is `4`.

wp_cache_get_last_changed( $group )   X-Ref
Get last changed date for the specified cache group.

return: string $last_changed UNIX timestamp with microseconds representing when the group was last changed.
param: string $group Where the cache contents are grouped.

wp_site_admin_email_change_notification( $old_email, $new_email, $option_name )   X-Ref
Send an email to the old site admin email address when the site admin email address changes.

param: string $old_email   The old site admin email address.
param: string $new_email   The new site admin email address.
param: string $option_name The relevant database option name.

wp_privacy_anonymize_ip( $ip_addr, $ipv6_fallback = false )   X-Ref
Return an anonymized IPv4 or IPv6 address.

return: string  The anonymized IP address.
param: string $ip_addr        The IPv4 or IPv6 address to be anonymized.
param: bool   $ipv6_fallback  Optional. Whether to return the original IPv6 address if the needed functions

wp_privacy_anonymize_data( $type, $data = '' )   X-Ref
Return uniform "anonymous" data by type.

return: string The anonymous data for the requested type.
param: string $type The type of data to be anonymized.
param: string $data Optional The data to be anonymized.

wp_privacy_exports_dir()   X-Ref
Returns the directory used to store personal data export files.

return: string Exports directory.

wp_privacy_exports_url()   X-Ref
Returns the URL of the directory used to store personal data export files.

return: string Exports directory URL.

wp_schedule_delete_old_privacy_export_files()   X-Ref
Schedule a `WP_Cron` job to delete expired export files.


wp_privacy_delete_old_export_files()   X-Ref
Cleans up export files older than three days old.

The export files are stored in `wp-content/uploads`, and are therefore publicly
accessible. A CSPRN is appended to the filename to mitigate the risk of an
unauthorized person downloading the file, but it is still possible. Deleting
the file after the data subject has had a chance to delete it adds an additional
layer of protection.




Generated: Sat Aug 18 08:20:02 2018 Cross-referenced by PHPXref 0.7