[ Index ]

WordPress Cross Reference

title

Body

[close]

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

Main WordPress API

File Size: 4193 lines (130 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 3 files
 wp-includes/class-IXR.php
 wp-includes/option.php
 wp-includes/default-widgets.php

Defines 131 functions

  mysql2date()
  current_time()
  date_i18n()
  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()
  wp_get_http_headers()
  is_new_day()
  build_query()
  _http_build_query()
  add_query_arg()
  remove_query_arg()
  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_original_referer()
  wp_mkdir_p()
  path_is_absolute()
  path_join()
  get_temp_dir()
  wp_is_writable()
  win_is_writable()
  wp_upload_dir()
  wp_unique_filename()
  wp_upload_bits()
  wp_ext2type()
  wp_check_filetype()
  wp_check_filetype_and_ext()
  wp_get_mime_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_send_json()
  wp_send_json_success()
  wp_send_json_error()
  _config_wp_home()
  _config_wp_siteurl()
  _mce_set_direction()
  smilies_init()
  wp_parse_args()
  wp_parse_id_list()
  wp_array_slice_assoc()
  wp_filter_object_list()
  wp_list_filter()
  wp_list_pluck()
  wp_maybe_load_widgets()
  wp_widgets_add_menu()
  wp_ob_end_flush_all()
  dead_db()
  absint()
  url_is_accessable_via_ssl()
  _deprecated_function()
  _deprecated_file()
  _deprecated_argument()
  _doing_it_wrong()
  is_lighttpd_before_150()
  apache_mod_loaded()
  iis7_supports_permalinks()
  validate_file()
  is_ssl()
  force_ssl_login()
  force_ssl_admin()
  wp_guess_url()
  wp_suspend_cache_addition()
  wp_suspend_cache_invalidation()
  is_main_site()
  is_main_network()
  global_terms_enabled()
  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()

Functions
Functions that are not part of a class:

mysql2date( $format, $date, $translate = true )   X-Ref
Converts 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.

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 is true.
return: string|int Formatted date string, or Unix timestamp.

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.

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.

param: string $type Either 'mysql' or 'timestamp'.
param: int|bool $gmt Optional. Whether to use GMT timezone. Default is false.
return: int|string String if $type is 'gmt', int if $type is 'timestamp'.

date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false )   X-Ref
Retrieve the date in localized format, based on timestamp.

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.

param: string $dateformatstring Format to display the date.
param: int $unixtimestamp Optional. Unix timestamp.
param: bool $gmt Optional, default is false. Whether to convert to GMT for time.
return: string The date, translated if locale specifies it.

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

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

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

It is easier to read 1kB than 1024 bytes and 1MB 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.
param: int|string $bytes Number of bytes. Note max integer size for integers.
param: int $decimals Precision of number of decimal places. Deprecated.
return: bool|string False on failure. Number string on success.

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

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

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

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

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.

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

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

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

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

param: mixed $data Data that might be serialized.
return: mixed A scalar data

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.

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

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.

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

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

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

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

param: string $content
return: array URLs found in passed string

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( $url, $file_path = false, $red = 1 )   X-Ref
Perform a HTTP HEAD or GET request.

If $file_path is a writable filename, this will do a GET request and write
the file to that path.

param: string $url URL to fetch.
param: string|bool $file_path Optional. File path to write request to.
param: int $red (private) The number of Redirects followed, Upon 5 being hit, returns false.
return: bool|string False on failure and string of headers if HEAD request.

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

param: string $url
param: bool $deprecated Not Used.
return: bool|string False on failure, headers on success.

is_new_day()   X-Ref
Whether today is a new day.

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.

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

_http_build_query($data, $prefix=null, $sep=null, $key='', $urlencode=true)   X-Ref
No description

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

You can rebuild the URL and append a new query variable to the URL query by
using this function. You can also retrieve the full URL with query data.

Adding a single key & value or an associative array. Setting a key value to
an empty string removes the key. Omitting oldquery_or_uri uses the $_SERVER
value. Additional values provided are expected to be encoded appropriately
with urlencode() or rawurlencode().

param: mixed $param1 Either newkey or an associative_array
param: mixed $param2 Either newvalue or oldquery or uri
param: mixed $param3 Optional. Old query or uri
return: string New URL query string.

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

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

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

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

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

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

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

param: string $query_vars Default WP_Query arguments.

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

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

status_header( $code )   X-Ref
Set HTTP status header.

param: int $code HTTP status code.

wp_get_nocache_headers()   X-Ref
Gets 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
Sets 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.

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

do_feed()   X-Ref
Loads 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
Test whether blog 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 option siteurl for whether WordPress is installed.

return: bool Whether blog is already installed.

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

param: string $actionurl URL to add nonce action.
param: string $action Optional. Nonce action name.
param: string $name Optional. Nonce name.
return: string URL with nonce action added.

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.

param: string $action Optional. Action name.
param: string $name Optional. Nonce name.
param: bool $referer Optional, default true. Whether to set the referer field for validation.
param: bool $echo Optional, default true. Whether to display or return hidden form field.
return: string Nonce field.

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.

param: bool $echo Whether to echo or return the referer field.
return: string Referer field.

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 {@link wp_referer_field()}, if that was posted already or it will
be the current page, if it doesn't exist.

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

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: string|bool False on failure. Referer URL on success.

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

return: string|bool 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.

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

path_is_absolute( $path )   X-Ref
Test if a give filesystem path is absolute ('/foo/bar', 'c:\windows').

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

path_join( $base, $path )   X-Ref
Join two filesystem paths together (e.g. 'give me $path relative to $base').

If the $path is absolute, then it the full path is returned.

param: string $base
param: string $path
return: string The path with the base or absolute path.

get_temp_dir()   X-Ref
Determines a writable directory for temporary files.
Function's preference is the return value of <code>sys_get_temp_dir()</code>,
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 <code>WP_TEMP_DIR</code> constant in
your <code>wp-config.php</code> 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.

param: string $path
return: bool

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.

param: string $path
return: bool

wp_upload_dir( $time = null )   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' - set to false.

param: string $time Optional. Time formatted in 'yyyy/mm'.
return: array See above for description.

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.

param: string $dir
param: string $filename
param: mixed $unique_filename_callback Callback.
return: string New filename, if given wasn't unique.

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.

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

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

param: string $ext The extension to search.
return: string|null The file type, example: audio, video, document, spreadsheet, etc. Null if not found.

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.

param: string $filename File name or path.
param: array $mimes Optional. Key is the file extension with value as the mime type.
return: array Values with extension first and 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 validating images known to getimagesize().

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

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.

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

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

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.

param: string $message Error message.
param: string $title Error title.
param: string|array $args Optional arguments to control behavior.

_default_wp_die_handler( $message, $title = '', $args = array()   X-Ref
Kill 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 wp_die_handler filter in wp_die

param: string $message Error message.
param: string $title Error title.
param: string|array $args Optional arguments to control behavior.

_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 Error title.
param: string|array $args Optional arguments to control behavior.

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

This is the handler for wp_die when processing Ajax requests.

param: string $message Optional. Response to print.

_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.

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

param: mixed $response Variable (usually an array or object) to encode as JSON, then print and die.

wp_send_json_success( $data = 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.

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

param: mixed $data Data to encode as JSON, then print and die.

_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.

param: string $url URL for the home location
return: string Homepage 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.

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

_mce_set_direction( $input )   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', 'plugins', and 'theme_advanced_button1' array
keys. These keys are then returned in the $input array.

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

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.

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

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

param: array|string $list
return: array Sanitized array of IDs

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

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

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

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

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

param: array $list An array of objects to filter
param: array $args An array of key => value arguments to match against each object
param: string $operator The logical operation to perform:
return: array

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

param: array $list A list of objects or arrays
param: int|string $field A field from the object to place instead of the entire object
return: array

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 our 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
Converts value to nonnegative integer.

param: mixed $maybeint Data you wish to have converted to a nonnegative integer
return: int An nonnegative integer

url_is_accessable_via_ssl($url)   X-Ref
Determines if the blog can be accessed over SSL.

Determines if blog can be accessed over SSL by using cURL to access the site
using the https in the siteurl. Requires cURL extension to work correctly.

param: string $url
return: bool Whether SSL access is available

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

There is a 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

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

There is a hook 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

_deprecated_argument( $function, $version, $message = null )   X-Ref
Marks a function argument as deprecated and informs 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:
<code>
if ( !empty($deprecated) )
_deprecated_argument( __FUNCTION__, '3.0' );
</code>

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.

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

There is a hook 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?

param: string $mod e.g. mod_rewrite
param: bool $default The default return value if the module is not found
return: bool

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

return: bool

validate_file( $file, $allowed_files = '' )   X-Ref
File validates against allowed set of defined rules.

A return value of '1' means that the $file contains either '..' or './'. A
return value of '2' means that the $file contains ':' after the first
character. A return value of '3' means that the file is not in the allowed
files list.

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

is_ssl()   X-Ref
Determine if SSL is used.

return: bool True if SSL, false if not used.

force_ssl_login( $force = null )   X-Ref
Whether SSL login should be forced.

param: string|bool $force Optional.
return: bool True if forced, false if not forced.

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

param: string|bool $force
return: bool True if forced, false if not forced.

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

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.

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

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

Turns cache invalidation on and off. Useful during imports where you don't wont 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.

param: bool $suspend Whether to suspend or enable cache invalidation
return: bool The current suspend setting

is_main_site( $site_id = null )   X-Ref
Whether a site is the main site of the current network.

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

is_main_network( $network_id = null )   X-Ref
Whether a network is the main network of the multisite install.

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

global_terms_enabled()   X-Ref
Whether global terms are enabled.

return: bool True if multisite and global terms enabled

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|bool

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

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

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

param: string $selected_zone Selected Zone
return: string

_cleanup_header_comment($str)   X-Ref
Strip close comment and close php tags from file headers used by WP.
See http://core.trac.wordpress.org/ticket/8497

param: string $str
return: string

wp_scheduled_delete()   X-Ref
Permanently deletes posts, pages, attachments, and comments which have been in the trash for EMPTY_TRASH_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.

param: string $file Path to the file
param: array $default_headers List of headers, in the format array('HeaderKey' => 'Header Name')
param: string $context If specified adds filter hook "extra_{$context}_headers"

__return_true()   X-Ref
Returns true.

Useful for returning true to filters easily.

return: bool true

__return_false()   X-Ref
Returns false.

Useful for returning false to filters easily.

return: bool 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

__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.

return: none

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

param: string $column
return: string

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

param: callback $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 ). Use null to always use $callback
param: array $callback_args optional additional arguments to send to $callback
return: array IDs of all members of loop

wp_find_hierarchy_loop_tortoise_hare( $callback, $start, $override = array()   X-Ref
Uses 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.

param: callback $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 an array of ( ID => parent_ID, ... ) to use instead of $callback
param: array $callback_args optional additional arguments to send to $callback
param: bool $_return_loop Return loop members or just detect presence of loop?
return: mixed scalar ID of some arbitrary member of the loop, or array of IDs of all members of loop if $_return_loop

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

return: none

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

return: array Array of allowed protocols

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.

param: string $ignore_class A class to ignore all function calls within - useful when you want to just give info about the callee
param: int $skip_frames A number of stack frames to skip - useful for unwinding back to the source of the issue
param: bool $pretty Whether or not you want a comma separated string or raw array returned
return: string|array Either a string containing a reversed comma separated trace or an array of individual calls.

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

param: array $object_ids ID list
param: string $cache_key The cache bucket to check against
return: array

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

return: bool true|false

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

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

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

return: bool true|false

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 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, $data )   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.


get_tag_regex( $tag )   X-Ref
Return RegEx body to liberally match 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

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

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

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

mbstring_binary_safe_encoding( $reset = false )   X-Ref
Sets the mbstring internal encoding to a binary safe encoding whne 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 Whether to reset the encoding back to a previously-set encoding.

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




Generated: Tue Mar 25 01:41:18 2014 WordPress honlapkészítés: online1.hu