/includes/functions.core.php

Description

From WP wp-includes/functions.php

Missing functions are indicated in comments

Functions
absint (line 662)

Converts value to nonnegative integer.

  • return: An nonnegative integer
  • since: 2.5.0
int absint (mixed $maybeint)
  • mixed $maybeint: Data you wish to have convered to an nonnegative integer
add_query_arg (line 216)

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 emptystring removes the key. Omitting oldquery_or_uri uses the $_SERVER value.

  • return: New URL query string.
  • since: 1.5.0
string add_query_arg (mixed $param1, mixed $param2, mixed $param3)
  • mixed $param1: Either newkey or an associative_array
  • mixed $param2: Either newvalue or oldquery or uri
  • mixed $param3: Optional. Old query or uri
apache_mod_loaded (line 697)

Does the specified module exist in the apache config?

  • since: 2.5.0
bool apache_mod_loaded (string $mod, [bool $default = false])
  • string $mod: e.g. mod_rewrite
  • bool $default: The default return value if the module is not found
backpress_convert_object (line 1076)
void backpress_convert_object ( &$object,  $output)
  • &$object
  • $output
backpress_die (line 1104)

Kill BackPress execution and display HTML message with error message.

This function calls the die() PHP function. The difference is that a message in 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 normally you should try to handle as many errors as possible silently.

void backpress_die (string $message, [string $title = ''], [string|array $args = array()])
  • string $message: Error message.
  • string $title: Error title.
  • string|array $args: Optional arguments to control behaviour.
backpress_gmt_strtotime (line 1059)

BackPress only below

void backpress_gmt_strtotime ( $string)
  • $string
backpress_set_cookie (line 1244)

Acts the same as core PHP setcookie() but its arguments are run through the backpress_set_cookie filter.

If the filter returns false, setcookie() isn't called.

void backpress_set_cookie ()
build_query (line 193)

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.

string build_query (array $data)
  • array $data: URL-encode key/value pairs.
cache_javascript_headers (line 494)

Set the headers for caching for 10 days with JavaScript content type.

  • since: 2.1.0
void cache_javascript_headers ()
current_time (line 34)

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.

  • return: String if $type is 'gmt', int if $type is 'timestamp'.
  • since: 1.0.0
int|string current_time (string $type, [int|bool $gmt = 0])
  • string $type: Either 'mysql' or 'timestamp'.
  • int|bool $gmt: Optional. Whether to use GMT timezone. Default is false.
force_ssl_admin (line 802)

Whether to force SSL used for the Administration Panels.

  • return: True if forced, false if not forced.
  • since: 2.6.0
bool force_ssl_admin ([string|bool $force = ''])
  • string|bool $force
force_ssl_login (line 780)

Whether SSL login should be forced.

  • return: True if forced, false if not forced.
  • since: 2.6.0
bool force_ssl_login ([string|bool $force = ''])
  • string|bool $force: Optional.
get_status_header_desc (line 343)

Retrieve the description for the HTTP status.

  • return: Empty string if not found, or description if found.
  • since: 2.3.0
string get_status_header_desc (int $code)
  • int $code: HTTP status code.
is_lighttpd_before_150 (line 680)

Is the server running earlier than 1.5.0 version of lighttpd

  • return: Whether the server is running lighttpd < 1.5.0
  • since: 2.5.0
bool is_lighttpd_before_150 ()
is_serialized (line 79)

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: False if not serialized and true if it was.
  • since: 2.0.5
bool is_serialized (mixed $data)
  • mixed $data: Value to check to see if was serialized.
is_serialized_string (line 115)

Check whether serialized data is of string type.

  • return: False if not a serialized string, true if it is.
  • since: 2.0.5
bool is_serialized_string (mixed $data)
  • mixed $data: Serialized data
is_ssl (line 758)

Determine if SSL is used.

  • return: True if SSL, false if not used.
  • since: 2.6.0
bool is_ssl ()
maybe_serialize (line 154)

Serialize data, if needed.

  • return: A scalar data
  • since: 2.0.5
mixed maybe_serialize (mixed $data)
  • mixed $data: Data that might be serialized.
maybe_unserialize (line 60)

Unserialize value only if it was serialized.

  • return: Unserialized data can be any type.
  • since: 2.0.0
mixed maybe_unserialize (string $original)
  • string $original: Maybe unserialized original, if is needed.
nocache_headers (line 481)

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.

void nocache_headers ()
remove_query_arg (line 292)

Removes an item or list from the query string.

  • return: New URL query string.
  • since: 1.5.0
string remove_query_arg (string|array $key, [bool $query = false])
  • string|array $key: Query key or keys to remove.
  • bool $query: When false uses the $_SERVER value.
status_header (line 427)

Set HTTP status header.

  • return: Does not return anything.
  • since: 2.0.0
  • uses: apply_filters() - Calls 'status_header' on status header string, HTTP HTTP code, HTTP code description, and protocol string as separate parameters.
null status_header (int $header)
  • int $header: HTTP status code
validate_file (line 733)

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.

  • return: 0 means nothing is wrong, greater than 0 means something was wrong.
  • since: 1.2.0
int validate_file (string $file, [array $allowed_files = ''])
  • string $file: File path.
  • array $allowed_files: List of allowed files.
wp_clone (line 1043)

Copy an object.

Returns a cloned copy of an object.

  • return: cloned object
  • since: 2.7.0
object The wp_clone (object $object)
  • object $object: The object to clone
wp_get_nocache_headers (line 456)

Gets the header information to prevent caching.

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

array wp_get_nocache_headers ()
wp_get_original_referer (line 597)

Retrieve original referer that was posted, if it exists.

  • return: False if no original referer or original referer if set.
  • since: 2.0.4
string|bool wp_get_original_referer ()
wp_get_referer (line 574)

Retrieve referer from '_wp_http_referer', HTTP referer, or current page respectively.

  • return: False on failure. Referer URL on success.
  • since: 2.0.4
string|bool wp_get_referer ()
wp_original_referer_field (line 554)

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: Original referer field.
  • since: 2.0.4
string wp_original_referer_field ([bool $echo = true], [string $jump_back_to = 'current'])
  • bool $echo: Whether to echo the original http referer
  • string $jump_back_to: Optional, default is 'current'. Can be 'previous' or page you want to jump back to.
wp_parse_args (line 633)

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.

array wp_parse_args (string|array $args, [array $defaults = ''])
  • string|array $args: Value to merge with $defaults
  • array $defaults: Array that serves as the defaults.
wp_referer_field (line 528)

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: Referer field.
  • since: 2.0.4
string wp_referer_field ([bool $echo = true])
  • bool $echo: Whether to echo or return the referer field.
wp_remote_fopen (line 314)

HTTP request for URI to retrieve content.

  • return: HTTP content. False on failure.
  • since: 1.5.1
  • uses: wp_remote_get()
bool|string wp_remote_fopen (string $uri)
  • string $uri: URI/URL of web page to retrieve.
wp_timezone_choice (line 910)

Gives a nicely formatted list of timezone strings // temporary! Not in final

void wp_timezone_choice ($selected_zone $selected_zone)
  • $selected_zone $selected_zone: string Selected Zone
wp_timezone_override_offset (line 827)

gmt_offset modification for smart timezone handling

Overrides the gmt_offset option if we have a timezone_string available

void wp_timezone_override_offset ()
wp_timezone_supported (line 849)

Check for PHP timezone support

void wp_timezone_supported ()
_cleanup_header_comment (line 1021)

Strip close comment and close php tags from file headers used by WP See http://core.trac.wordpress.org/ticket/8497

  • since: 2.8
void _cleanup_header_comment ( $str)
  • $str
_wp_timezone_choice_usort_callback (line 864)
void _wp_timezone_choice_usort_callback ( $a,  $b)
  • $a
  • $b

Documentation generated on Fri, 18 May 2012 01:33:57 +0100 by phpDocumentor 1.4.3