<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[28109] trunk/src/wp-includes/functions.php: Inline documentation for hooks in wp-includes/functions.php.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://core.trac.wordpress.org/changeset/28109">28109</a></dd>
<dt>Author</dt> <dd>DrewAPicture</dd>
<dt>Date</dt> <dd>2014-04-14 00:19:37 +0000 (Mon, 14 Apr 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Inline documentation for hooks in wp-includes/functions.php.
Props jesin, GaryJ.
Fixes <a href="http://core.trac.wordpress.org/ticket/27715">#27715</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpincludesfunctionsphp">trunk/src/wp-includes/functions.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpincludesfunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/src/wp-includes/functions.php (28108 => 28109)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/functions.php 2014-04-14 00:06:03 UTC (rev 28108)
+++ trunk/src/wp-includes/functions.php 2014-04-14 00:19:37 UTC (rev 28109)
</span><span class="lines">@@ -140,8 +140,18 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> $j = @$datefunc( $dateformatstring, $i );
</span><del>- // allow plugins to redo this entirely for languages with untypical grammars
- $j = apply_filters('date_i18n', $j, $req_format, $i, $gmt);
</del><ins>+
+ /**
+ * Filter the date formatted based on the locale.
+ *
+ * @since 2.8.0
+ *
+ * @param string $j Formatted date string.
+ * @param string $req_format Format to display the date.
+ * @param int $i Unix timestamp.
+ * @param bool $gmt Whether to convert to GMT for time. Default false.
+ */
+ $j = apply_filters( 'date_i18n', $j, $req_format, $i, $gmt );
</ins><span class="cx"> return $j;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -157,6 +167,14 @@
</span><span class="cx"> function number_format_i18n( $number, $decimals = 0 ) {
</span><span class="cx"> global $wp_locale;
</span><span class="cx"> $formatted = number_format( $number, absint( $decimals ), $wp_locale->number_format['decimal_point'], $wp_locale->number_format['thousands_sep'] );
</span><ins>+
+ /**
+ * Filter the number formatted based on the locale.
+ *
+ * @since 2.8.0
+ *
+ * @param string $formatted Converted number in string format.
+ */
</ins><span class="cx"> return apply_filters( 'number_format_i18n', $formatted );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -917,6 +935,17 @@
</span><span class="cx"> $protocol = 'HTTP/1.0';
</span><span class="cx"> $status_header = "$protocol $code $description";
</span><span class="cx"> if ( function_exists( 'apply_filters' ) )
</span><ins>+
+ /**
+ * Filter an HTTP status header.
+ *
+ * @since 2.2.0
+ *
+ * @param string $status_header HTTP status header.
+ * @param int $code HTTP status code.
+ * @param string $description Description for the status code.
+ * @param string $protocol Server protocol.
+ */
</ins><span class="cx"> $status_header = apply_filters( 'status_header', $status_header, $code, $description, $protocol );
</span><span class="cx">
</span><span class="cx"> @header( $status_header, true, $code );
</span><span class="lines">@@ -940,7 +969,20 @@
</span><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> if ( function_exists('apply_filters') ) {
</span><del>- $headers = (array) apply_filters('nocache_headers', $headers);
</del><ins>+ /**
+ * Filter the cache-controlling headers.
+ *
+ * @since 2.8.0
+ *
+ * @param array $headers {
+ * Header names and field values.
+ *
+ * @type string $Expires Expires header.
+ * @type string $Cache-Control Cache-Control header.
+ * @type string $Pragma Pragma header.
+ * }
+ */
+ $headers = (array) apply_filters( 'nocache_headers', $headers );
</ins><span class="cx"> }
</span><span class="cx"> $headers['Last-Modified'] = false;
</span><span class="cx"> return $headers;
</span><span class="lines">@@ -1023,8 +1065,8 @@
</span><span class="cx"> * It is better to only have one hook for each feed.
</span><span class="cx"> *
</span><span class="cx"> * @since 2.1.0
</span><ins>+ *
</ins><span class="cx"> * @uses $wp_query Used to tell if the use a comment feed.
</span><del>- * @uses do_action() Calls 'do_feed_$feed' hook, if a hook exists for the feed.
</del><span class="cx"> */
</span><span class="cx"> function do_feed() {
</span><span class="cx"> global $wp_query;
</span><span class="lines">@@ -1041,6 +1083,15 @@
</span><span class="cx"> if ( ! has_action( $hook ) )
</span><span class="cx"> wp_die( __( 'ERROR: This is not a valid feed template.' ), '', array( 'response' => 404 ) );
</span><span class="cx">
</span><ins>+ /**
+ * Fires once the given feed is loaded.
+ *
+ * The dynamic hook name, $hook, refers to the feed name.
+ *
+ * @since 2.1.0
+ *
+ * @param bool $is_comment_feed Whether the feed is a comment feed.
+ */
</ins><span class="cx"> do_action( $hook, $wp_query->is_comment_feed );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1097,11 +1148,15 @@
</span><span class="cx"> * robots.txt file.
</span><span class="cx"> *
</span><span class="cx"> * @since 2.1.0
</span><del>- * @uses do_action() Calls 'do_robotstxt' hook for displaying robots.txt rules.
</del><span class="cx"> */
</span><span class="cx"> function do_robots() {
</span><span class="cx"> header( 'Content-Type: text/plain; charset=utf-8' );
</span><span class="cx">
</span><ins>+ /**
+ * Fires when displaying the robots.txt file.
+ *
+ * @since 2.1.0
+ */
</ins><span class="cx"> do_action( 'do_robotstxt' );
</span><span class="cx">
</span><span class="cx"> $output = "User-agent: *\n";
</span><span class="lines">@@ -1115,7 +1170,15 @@
</span><span class="cx"> $output .= "Disallow: $path/wp-includes/\n";
</span><span class="cx"> }
</span><span class="cx">
</span><del>- echo apply_filters('robots_txt', $output, $public);
</del><ins>+ /**
+ * Filter the robots.txt output.
+ *
+ * @since 3.0.0
+ *
+ * @param string $output Robots.txt output.
+ * @param bool $public Whether the site is considered "public".
+ */
+ echo apply_filters( 'robots_txt', $output, $public );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -1568,7 +1631,6 @@
</span><span class="cx"> * 'error' - set to false.
</span><span class="cx"> *
</span><span class="cx"> * @since 2.0.0
</span><del>- * @uses apply_filters() Calls 'upload_dir' on returned array.
</del><span class="cx"> *
</span><span class="cx"> * @param string $time Optional. Time formatted in 'yyyy/mm'.
</span><span class="cx"> * @return array See above for description.
</span><span class="lines">@@ -1655,6 +1717,14 @@
</span><span class="cx"> $dir .= $subdir;
</span><span class="cx"> $url .= $subdir;
</span><span class="cx">
</span><ins>+ /**
+ * Filter the uploads directory data.
+ *
+ * @since 2.0.0
+ *
+ * @param array $uploads Array of upload directory data with keys of 'path',
+ * 'url', 'subdir, 'basedir', and 'error'.
+ */
</ins><span class="cx"> $uploads = apply_filters( 'upload_dir',
</span><span class="cx"> array(
</span><span class="cx"> 'path' => $dir,
</span><span class="lines">@@ -1780,6 +1850,16 @@
</span><span class="cx"> if ( $upload['error'] !== false )
</span><span class="cx"> return $upload;
</span><span class="cx">
</span><ins>+ /**
+ * Filter whether to treat the upload bits as an error.
+ *
+ * Passing a non-array to the filter will effectively short-circuit preparing
+ * the upload bits, returning that value instead.
+ *
+ * @since 3.0.0
+ *
+ * @param mixed $upload_bits_error An array of upload bits data, or a non-array error to return.
+ */
</ins><span class="cx"> $upload_bits_error = apply_filters( 'wp_upload_bits', array( 'name' => $name, 'bits' => $bits, 'time' => $time ) );
</span><span class="cx"> if ( !is_array( $upload_bits_error ) ) {
</span><span class="cx"> $upload[ 'error' ] = $upload_bits_error;
</span><span class="lines">@@ -1824,13 +1904,24 @@
</span><span class="cx"> * Retrieve the file type based on the extension name.
</span><span class="cx"> *
</span><span class="cx"> * @since 2.5.0
</span><del>- * @uses apply_filters() Calls 'ext2type' hook on default supported types.
</del><span class="cx"> *
</span><span class="cx"> * @param string $ext The extension to search.
</span><del>- * @return string|null The file type, example: audio, video, document, spreadsheet, etc. Null if not found.
</del><ins>+ * @return string|null The file type, example: audio, video, document, spreadsheet, etc.
+ * Null if not found.
</ins><span class="cx"> */
</span><span class="cx"> function wp_ext2type( $ext ) {
</span><span class="cx"> $ext = strtolower( $ext );
</span><ins>+
+ /**
+ * Filter file type based on the extension name.
+ *
+ * @since 2.5.0
+ *
+ * @see wp_ext2type()
+ *
+ * @param array $ext2type Multi-dimensional array with extensions for a default set
+ * of file types.
+ */
</ins><span class="cx"> $ext2type = apply_filters( 'ext2type', array(
</span><span class="cx"> 'image' => array( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp', 'tif', 'tiff', 'ico' ),
</span><span class="cx"> 'audio' => array( 'aac', 'ac3', 'aif', 'aiff', 'm3a', 'm4a', 'm4b', 'mka', 'mp1', 'mp2', 'mp3', 'ogg', 'oga', 'ram', 'wav', 'wma' ),
</span><span class="lines">@@ -1915,8 +2006,13 @@
</span><span class="cx">
</span><span class="cx"> // If getimagesize() knows what kind of image it really is and if the real MIME doesn't match the claimed MIME
</span><span class="cx"> if ( !empty($imgstats['mime']) && $imgstats['mime'] != $type ) {
</span><del>- // This is a simplified array of MIMEs that getimagesize() can detect and their extensions
- // You shouldn't need to use this filter, but it's here just in case
</del><ins>+ /**
+ * Filter the list mapping image mime types to their respective extensions.
+ *
+ * @since 3.0.0
+ *
+ * @param array $mime_to_ext Array of image mime types and their matching extensions.
+ */
</ins><span class="cx"> $mime_to_ext = apply_filters( 'getimagesize_mimes_to_exts', array(
</span><span class="cx"> 'image/jpeg' => 'jpg',
</span><span class="cx"> 'image/png' => 'png',
</span><span class="lines">@@ -1942,8 +2038,18 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // Let plugins try and validate other types of files
- // Should return an array in the style of array( 'ext' => $ext, 'type' => $type, 'proper_filename' => $proper_filename )
</del><ins>+ /**
+ * Filter the "real" file type of the given file.
+ *
+ * @since 3.0.0
+ *
+ * @param array $wp_check_filetype_and_ext File data array containing 'ext', 'type', and
+ * 'proper_filename' keys.
+ * @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 Key is the file extension with value as the mime type.
+ */
</ins><span class="cx"> return apply_filters( 'wp_check_filetype_and_ext', compact( 'ext', 'type', 'proper_filename' ), $file, $filename, $mimes );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1952,13 +2058,20 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 3.5.0
</span><span class="cx"> *
</span><del>- * @uses apply_filters() Calls 'mime_types' on returned array. This filter should
- * be used to add types, not remove them. To remove types use the upload_mimes filter.
- *
</del><span class="cx"> * @return array Array of mime types keyed by the file extension regex corresponding to those types.
</span><span class="cx"> */
</span><span class="cx"> function wp_get_mime_types() {
</span><del>- // Accepted MIME types are set here as PCRE unless provided.
</del><ins>+ /**
+ * Filter the list of mime types and file extensions.
+ *
+ * This filter should be used to add, not remove, mime types. To remove
+ * mime types, use the 'upload_mimes' filter.
+ *
+ * @since 3.5.0
+ *
+ * @param array $wp_get_mime_types Mime types keyed by the file extension regex
+ * corresponding to those types.
+ */
</ins><span class="cx"> return apply_filters( 'mime_types', array(
</span><span class="cx"> // Image formats
</span><span class="cx"> 'jpg|jpeg|jpe' => 'image/jpeg',
</span><span class="lines">@@ -2059,7 +2172,6 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.8.6
</span><span class="cx"> *
</span><del>- * @uses apply_filters() Calls 'upload_mimes' on returned array
</del><span class="cx"> * @uses wp_get_upload_mime_types() to fetch the list of mime types
</span><span class="cx"> *
</span><span class="cx"> * @param int|WP_User $user Optional. User to check. Defaults to current user.
</span><span class="lines">@@ -2075,6 +2187,16 @@
</span><span class="cx"> if ( empty( $unfiltered ) )
</span><span class="cx"> unset( $t['htm|html'] );
</span><span class="cx">
</span><ins>+ /**
+ * Filter list of allowed mime types and file extensions.
+ *
+ * @since 2.0.0
+ *
+ * @param array $t Mime types keyed by the file extension regex corresponding to
+ * those types. 'swf' and 'exe' removed from full list. 'htm|html' also
+ * removed depending on '$user' capabilities.
+ * @param int|WP_User|null $user User ID, User object or null if not provided (indicates current user).
+ */
</ins><span class="cx"> return apply_filters( 'upload_mimes', $t, $user );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -2119,12 +2241,34 @@
</span><span class="cx"> * @param string|array $args Optional arguments to control behavior.
</span><span class="cx"> */
</span><span class="cx"> function wp_die( $message = '', $title = '', $args = array() ) {
</span><del>- if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
</del><ins>+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
+ /**
+ * Filter callback for killing WordPress execution for AJAX requests.
+ *
+ * @since 3.4.0
+ *
+ * @param callback $function Callback function name.
+ */
</ins><span class="cx"> $function = apply_filters( 'wp_die_ajax_handler', '_ajax_wp_die_handler' );
</span><del>- elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST )
</del><ins>+ } elseif ( defined( 'XMLRPC_REQUEST' ) && XMLRPC_REQUEST ) {
+ /**
+ * Filter callback for killing WordPress execution for XML-RPC requests.
+ *
+ * @since 3.4.0
+ *
+ * @param callback $function Callback function name.
+ */
</ins><span class="cx"> $function = apply_filters( 'wp_die_xmlrpc_handler', '_xmlrpc_wp_die_handler' );
</span><del>- else
</del><ins>+ } else {
+ /**
+ * Filter callback for killing WordPress execution for all non-AJAX, non-XML-RPC requests.
+ *
+ * @since 3.0.0
+ *
+ * @param callback $function Callback function name.
+ */
</ins><span class="cx"> $function = apply_filters( 'wp_die_handler', '_default_wp_die_handler' );
</span><ins>+ }
</ins><span class="cx">
</span><span class="cx"> call_user_func( $function, $message, $title, $args );
</span><span class="cx"> }
</span><span class="lines">@@ -2747,8 +2891,17 @@
</span><span class="cx"> * @uses add_action() Calls '_admin_menu' hook with 'wp_widgets_add_menu' value.
</span><span class="cx"> */
</span><span class="cx"> function wp_maybe_load_widgets() {
</span><del>- if ( ! apply_filters('load_default_widgets', true) )
</del><ins>+ /**
+ * Filter whether to load the Widgets library.
+ *
+ * @since 2.8.0
+ *
+ * @param bool $wp_maybe_load_widgets Whether to load the Widgets library.
+ * Default true.
+ */
+ if ( ! apply_filters( 'load_default_widgets', true ) ) {
</ins><span class="cx"> return;
</span><ins>+ }
</ins><span class="cx"> require_once( ABSPATH . WPINC . '/default-widgets.php' );
</span><span class="cx"> add_action( '_admin_menu', 'wp_widgets_add_menu' );
</span><span class="cx"> }
</span><span class="lines">@@ -2895,20 +3048,30 @@
</span><span class="cx"> * @since 2.5.0
</span><span class="cx"> * @access private
</span><span class="cx"> *
</span><del>- * @uses do_action() Calls 'deprecated_function_run' and passes the function name, what to use instead,
- * and the version the function was deprecated in.
- * @uses apply_filters() Calls 'deprecated_function_trigger_error' and expects boolean value of true to do
- * trigger or false to not trigger error.
- *
</del><span class="cx"> * @param string $function The function that was called
</span><span class="cx"> * @param string $version The version of WordPress that deprecated the function
</span><span class="cx"> * @param string $replacement Optional. The function that should have been called
</span><span class="cx"> */
</span><span class="cx"> function _deprecated_function( $function, $version, $replacement = null ) {
</span><span class="cx">
</span><ins>+ /**
+ * Fires when a deprecated function is called.
+ *
+ * @since 2.5.0
+ *
+ * @param string $function The function that was called.
+ * @param string $replacement The function that should have been called.
+ * @param string $version The version of WordPress that deprecated the function.
+ */
</ins><span class="cx"> do_action( 'deprecated_function_run', $function, $replacement, $version );
</span><span class="cx">
</span><del>- // Allow plugin to filter the output error trigger
</del><ins>+ /**
+ * Filter whether to trigger an error for deprecated functions.
+ *
+ * @since 2.5.0
+ *
+ * @param bool $trigger Whether to trigger the error for deprecated functions. Default true.
+ */
</ins><span class="cx"> if ( WP_DEBUG && apply_filters( 'deprecated_function_trigger_error', true ) ) {
</span><span class="cx"> if ( function_exists( '__' ) ) {
</span><span class="cx"> if ( ! is_null( $replacement ) )
</span><span class="lines">@@ -2938,11 +3101,6 @@
</span><span class="cx"> * @since 2.5.0
</span><span class="cx"> * @access private
</span><span class="cx"> *
</span><del>- * @uses do_action() Calls 'deprecated_file_included' and passes the file name, what to use instead,
- * the version in which the file was deprecated, and any message regarding the change.
- * @uses apply_filters() Calls 'deprecated_file_trigger_error' and expects boolean value of true to do
- * trigger or false to not trigger error.
- *
</del><span class="cx"> * @param string $file The file that was included
</span><span class="cx"> * @param string $version The version of WordPress that deprecated the file
</span><span class="cx"> * @param string $replacement Optional. The file that should have been included based on ABSPATH
</span><span class="lines">@@ -2950,9 +3108,25 @@
</span><span class="cx"> */
</span><span class="cx"> function _deprecated_file( $file, $version, $replacement = null, $message = '' ) {
</span><span class="cx">
</span><ins>+ /**
+ * Fires when a deprecated file is called.
+ *
+ * @since 2.5.0
+ *
+ * @param string $file The file that was called.
+ * @param string $replacement The file that should have been included based on ABSPATH.
+ * @param string $version The version of WordPress that deprecated the file.
+ * @param string $message A message regarding the change.
+ */
</ins><span class="cx"> do_action( 'deprecated_file_included', $file, $replacement, $version, $message );
</span><span class="cx">
</span><del>- // Allow plugin to filter the output error trigger
</del><ins>+ /**
+ * Filter whether to trigger an error for deprecated files.
+ *
+ * @since 2.5.0
+ *
+ * @param bool $trigger Whether to trigger the error for deprecated files. Default true.
+ */
</ins><span class="cx"> if ( WP_DEBUG && apply_filters( 'deprecated_file_trigger_error', true ) ) {
</span><span class="cx"> $message = empty( $message ) ? '' : ' ' . $message;
</span><span class="cx"> if ( function_exists( '__' ) ) {
</span><span class="lines">@@ -2989,20 +3163,30 @@
</span><span class="cx"> * @since 3.0.0
</span><span class="cx"> * @access private
</span><span class="cx"> *
</span><del>- * @uses do_action() Calls 'deprecated_argument_run' and passes the function name, a message on the change,
- * and the version in which the argument was deprecated.
- * @uses apply_filters() Calls 'deprecated_argument_trigger_error' and expects boolean value of true to do
- * trigger or false to not trigger error.
- *
</del><span class="cx"> * @param string $function The function that was called
</span><span class="cx"> * @param string $version The version of WordPress that deprecated the argument used
</span><span class="cx"> * @param string $message Optional. A message regarding the change.
</span><span class="cx"> */
</span><span class="cx"> function _deprecated_argument( $function, $version, $message = null ) {
</span><span class="cx">
</span><ins>+ /**
+ * Fires when a deprecated argument is called.
+ *
+ * @since 3.0.0
+ *
+ * @param string $function The function that was called.
+ * @param string $message A message regarding the change.
+ * @param string $version The version of WordPress that deprecated the argument used.
+ */
</ins><span class="cx"> do_action( 'deprecated_argument_run', $function, $message, $version );
</span><span class="cx">
</span><del>- // Allow plugin to filter the output error trigger
</del><ins>+ /**
+ * Filter whether to trigger an error for deprecated arguments.
+ *
+ * @since 3.0.0
+ *
+ * @param bool $trigger Whether to trigger the error for deprecated arguments. Default true.
+ */
</ins><span class="cx"> if ( WP_DEBUG && apply_filters( 'deprecated_argument_trigger_error', true ) ) {
</span><span class="cx"> if ( function_exists( '__' ) ) {
</span><span class="cx"> if ( ! is_null( $message ) )
</span><span class="lines">@@ -3030,19 +3214,30 @@
</span><span class="cx"> * @since 3.1.0
</span><span class="cx"> * @access private
</span><span class="cx"> *
</span><del>- * @uses do_action() Calls 'doing_it_wrong_run' and passes the function arguments.
- * @uses apply_filters() Calls 'doing_it_wrong_trigger_error' and expects boolean value of true to do
- * trigger or false to not trigger error.
- *
</del><span class="cx"> * @param string $function The function that was called.
</span><span class="cx"> * @param string $message A message explaining what has been done incorrectly.
</span><span class="cx"> * @param string $version The version of WordPress where the message was added.
</span><span class="cx"> */
</span><span class="cx"> function _doing_it_wrong( $function, $message, $version ) {
</span><span class="cx">
</span><ins>+ /**
+ * Fires when the given function is being used incorrectly.
+ *
+ * @since 3.1.0
+ *
+ * @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.
+ */
</ins><span class="cx"> do_action( 'doing_it_wrong_run', $function, $message, $version );
</span><span class="cx">
</span><del>- // Allow plugin to filter the output error trigger
</del><ins>+ /**
+ * Filter whether to trigger an error for _doing_it_wrong() calls.
+ *
+ * @since 3.1.0
+ *
+ * @param bool $trigger Whether to trigger the error for _doing_it_wrong() calls. Default true.
+ */
</ins><span class="cx"> if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true ) ) {
</span><span class="cx"> if ( function_exists( '__' ) ) {
</span><span class="cx"> $version = is_null( $version ) ? '' : sprintf( __( '(This message was added in version %s.)' ), $version );
</span><span class="lines">@@ -3122,7 +3317,14 @@
</span><span class="cx"> $supports_permalinks = class_exists('DOMDocument') && isset($_SERVER['IIS_UrlRewriteModule']) && ( php_sapi_name() == 'cgi-fcgi' );
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return apply_filters('iis7_supports_permalinks', $supports_permalinks);
</del><ins>+ /**
+ * Filter whether IIS 7+ supports pretty permalinks.
+ *
+ * @since 2.8.0
+ *
+ * @param bool $supports_permalinks Whether IIS7 supports permalinks. Default false.
+ */
+ return apply_filters( 'iis7_supports_permalinks', $supports_permalinks );
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><span class="lines">@@ -3379,6 +3581,17 @@
</span><span class="cx">
</span><span class="cx"> static $global_terms = null;
</span><span class="cx"> if ( is_null( $global_terms ) ) {
</span><ins>+
+ /**
+ * Filter whether global terms are enabled.
+ *
+ * Passing a non-null value to the filter will effectively short-circuit the function,
+ * returning the value of the 'global_terms_enabled' site option instead.
+ *
+ * @since 3.0.0
+ *
+ * @param null $anbled Whether global terms are enabled.
+ */
</ins><span class="cx"> $filter = apply_filters( 'global_terms_enabled', null );
</span><span class="cx"> if ( ! is_null( $filter ) )
</span><span class="cx"> $global_terms = (bool) $filter;
</span><span class="lines">@@ -3674,6 +3887,16 @@
</span><span class="cx"> // Make sure we catch CR-only line endings.
</span><span class="cx"> $file_data = str_replace( "\r", "\n", $file_data );
</span><span class="cx">
</span><ins>+ /**
+ * Filter extra file headers by context.
+ *
+ * The dynamic portion of the hook name, $context, refers to the context
+ * where extra headers might be loaded.
+ *
+ * @since 2.9.0
+ *
+ * @param array $extra_context_headers Empty array by default.
+ */
</ins><span class="cx"> if ( $context && $extra_headers = apply_filters( "extra_{$context}_headers", array() ) ) {
</span><span class="cx"> $extra_headers = array_combine( $extra_headers, $extra_headers ); // keys equal values
</span><span class="cx"> $all_headers = array_merge( $extra_headers, (array) $default_headers );
</span><span class="lines">@@ -3895,6 +4118,14 @@
</span><span class="cx">
</span><span class="cx"> if ( empty( $protocols ) ) {
</span><span class="cx"> $protocols = array( 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn', 'tel', 'fax', 'xmpp' );
</span><ins>+
+ /**
+ * Filter the list of protocols allowed in HTML attributes.
+ *
+ * @since 3.0.0
+ *
+ * @param array $protocols Array of allowed protocols e.g. 'http', 'ftp', 'tel', and more.
+ */
</ins><span class="cx"> $protocols = apply_filters( 'kses_allowed_protocols', $protocols );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4012,6 +4243,14 @@
</span><span class="cx"> * @return bool true|false
</span><span class="cx"> */
</span><span class="cx"> function wp_checkdate( $month, $day, $year, $source_date ) {
</span><ins>+ /**
+ * Filter whether the given date is valid for the Gregorian calendar.
+ *
+ * @since 3.5.0
+ *
+ * @param bool $checkdate Whether the given date is valid.
+ * @param string $source_date Date to check.
+ */
</ins><span class="cx"> return apply_filters( 'wp_checkdate', checkdate( $month, $day, $year ), $source_date );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -4037,6 +4276,14 @@
</span><span class="cx"> $hidden = array( 'update', 'update-network', 'update-core', 'update-core-network', 'upgrade', 'upgrade-network', 'network' );
</span><span class="cx"> $show = ! in_array( $screen->id, $hidden );
</span><span class="cx">
</span><ins>+ /**
+ * Filter whether to load the authentication check.
+ *
+ * @since 3.6.0
+ *
+ * @param bool $show Whether to load the authentication check.
+ * @param WP_Screen $screen The current screen object.
+ */
</ins><span class="cx"> if ( apply_filters( 'wp_auth_check_load', $show, $screen ) ) {
</span><span class="cx"> wp_enqueue_style( 'wp-auth-check' );
</span><span class="cx"> wp_enqueue_script( 'wp-auth-check' );
</span><span class="lines">@@ -4059,7 +4306,13 @@
</span><span class="cx"> if ( $same_domain && force_ssl_login() && ! force_ssl_admin() )
</span><span class="cx"> $same_domain = false;
</span><span class="cx">
</span><del>- // Let plugins change this if they know better.
</del><ins>+ /**
+ * Filter whether the authentication check originated at the same domain.
+ *
+ * @since 3.6.0
+ *
+ * @param bool $same_domain Whether the authentication check originated at the same domain.
+ */
</ins><span class="cx"> $same_domain = apply_filters( 'wp_auth_check_same_domain', $same_domain );
</span><span class="cx"> $wrap_class = $same_domain ? 'hidden' : 'hidden fallback';
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>