<!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>[28918] trunk/src/wp-includes/functions.php: General inline documentation improvements 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/28918">28918</a></dd>
<dt>Author</dt> <dd>DrewAPicture</dd>
<dt>Date</dt> <dd>2014-06-30 03:55:03 +0000 (Mon, 30 Jun 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>General inline documentation improvements in wp-includes/functions.php.
First run. See <a href="http://core.trac.wordpress.org/ticket/26185">#26185</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 (28917 => 28918)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/src/wp-includes/functions.php 2014-06-30 03:46:22 UTC (rev 28917)
+++ trunk/src/wp-includes/functions.php 2014-06-30 03:55:03 UTC (rev 28918)
</span><span class="lines">@@ -8,7 +8,7 @@
</span><span class="cx"> require( ABSPATH . WPINC . '/option.php' );
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Converts given date string into a different format.
</del><ins>+ * Convert given date string into a different format.
</ins><span class="cx"> *
</span><span class="cx"> * $format should be either a PHP date format string, e.g. 'U' for a Unix
</span><span class="cx"> * timestamp, or 'G' for a Unix timestamp assuming that $date is GMT.
</span><span class="lines">@@ -18,9 +18,9 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 0.71
</span><span class="cx"> *
</span><del>- * @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.
</del><ins>+ * @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.
</ins><span class="cx"> * @return string|int Formatted date string, or Unix timestamp.
</span><span class="cx"> */
</span><span class="cx"> function mysql2date( $format, $date, $translate = true ) {
</span><span class="lines">@@ -53,8 +53,9 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 1.0.0
</span><span class="cx"> *
</span><del>- * @param string $type 'mysql', 'timestamp', or PHP date format string (e.g. 'Y-m-d').
- * @param int|bool $gmt Optional. Whether to use GMT timezone. Default is false.
</del><ins>+ * @param string $type Type of time to retrieve. Accepts 'mysql', 'timestamp', or PHP date
+ * format string (e.g. 'Y-m-d').
+ * @param int|bool $gmt Optional. Whether to use GMT timezone. Default false.
</ins><span class="cx"> * @return int|string Integer if $type is 'timestamp', string otherwise.
</span><span class="cx"> */
</span><span class="cx"> function current_time( $type, $gmt = 0 ) {
</span><span class="lines">@@ -97,8 +98,10 @@
</span><span class="cx"> $gmt = true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // store original value for language with untypical grammars
- // see http://core.trac.wordpress.org/ticket/9396
</del><ins>+ /*
+ * Store original value for language with untypical grammars.
+ * See http://core.trac.wordpress.org/ticket/9396
+ */
</ins><span class="cx"> $req_format = $dateformatstring;
</span><span class="cx">
</span><span class="cx"> $datefunc = $gmt? 'gmdate' : 'date';
</span><span class="lines">@@ -158,8 +161,8 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.3.0
</span><span class="cx"> *
</span><del>- * @param int $number The number to convert based on locale.
- * @param int $decimals Precision of the number of decimal places.
</del><ins>+ * @param int $number The number to convert based on locale.
+ * @param int $decimals Optional. Precision of the number of decimal places. Default 0.
</ins><span class="cx"> * @return string Converted number in string format.
</span><span class="cx"> */
</span><span class="cx"> function number_format_i18n( $number, $decimals = 0 ) {
</span><span class="lines">@@ -189,12 +192,11 @@
</span><span class="cx"> * be converted to a double, which should always have 64 bit length.
</span><span class="cx"> *
</span><span class="cx"> * Technically the correct unit names for powers of 1024 are KiB, MiB etc.
</span><del>- * @link http://en.wikipedia.org/wiki/Byte
</del><span class="cx"> *
</span><span class="cx"> * @since 2.3.0
</span><span class="cx"> *
</span><del>- * @param int|string $bytes Number of bytes. Note max integer size for integers.
- * @param int $decimals Precision of number of decimal places. Deprecated.
</del><ins>+ * @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.
</ins><span class="cx"> * @return bool|string False on failure. Number string on success.
</span><span class="cx"> */
</span><span class="cx"> function size_format( $bytes, $decimals = 0 ) {
</span><span class="lines">@@ -223,19 +225,32 @@
</span><span class="cx"> * @return array Keys are 'start' and 'end'.
</span><span class="cx"> */
</span><span class="cx"> function get_weekstartend( $mysqlstring, $start_of_week = '' ) {
</span><del>- $my = substr( $mysqlstring, 0, 4 ); // Mysql string Year
- $mm = substr( $mysqlstring, 8, 2 ); // Mysql string Month
- $md = substr( $mysqlstring, 5, 2 ); // Mysql string day
- $day = mktime( 0, 0, 0, $md, $mm, $my ); // The timestamp for mysqlstring day.
- $weekday = date( 'w', $day ); // The day of the week from the timestamp
</del><ins>+ // Mysql string year.
+ $my = substr( $mysqlstring, 0, 4 );
+
+ // Mysql string month.
+ $mm = substr( $mysqlstring, 8, 2 );
+
+ // Mysql string day.
+ $md = substr( $mysqlstring, 5, 2 );
+
+ // The timestamp for mysqlstring day.
+ $day = mktime( 0, 0, 0, $md, $mm, $my );
+
+ // The day of the week from the timestamp.
+ $weekday = date( 'w', $day );
+
</ins><span class="cx"> if ( !is_numeric($start_of_week) )
</span><span class="cx"> $start_of_week = get_option( 'start_of_week' );
</span><span class="cx">
</span><span class="cx"> if ( $weekday < $start_of_week )
</span><span class="cx"> $weekday += 7;
</span><span class="cx">
</span><del>- $start = $day - DAY_IN_SECONDS * ( $weekday - $start_of_week ); // The most recent week start day on or before $day
- $end = $start + 7 * DAY_IN_SECONDS - 1; // $start + 7 days - 1 second
</del><ins>+ // The most recent week start day on or before $day.
+ $start = $day - DAY_IN_SECONDS * ( $weekday - $start_of_week );
+
+ // $start + 7 days - 1 second.
+ $end = $start + 7 * DAY_IN_SECONDS - 1;
</ins><span class="cx"> return compact( 'start', 'end' );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -261,12 +276,12 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.0.5
</span><span class="cx"> *
</span><del>- * @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.
</del><ins>+ * @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.
</ins><span class="cx"> * @return bool False if not serialized and true if it was.
</span><span class="cx"> */
</span><span class="cx"> function is_serialized( $data, $strict = true ) {
</span><del>- // if it isn't a string, it isn't serialized
</del><ins>+ // if it isn't a string, it isn't serialized.
</ins><span class="cx"> if ( ! is_string( $data ) ) {
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="lines">@@ -325,11 +340,11 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.0.5
</span><span class="cx"> *
</span><del>- * @param mixed $data Serialized data
</del><ins>+ * @param string $data Serialized data.
</ins><span class="cx"> * @return bool False if not a serialized string, true if it is.
</span><span class="cx"> */
</span><span class="cx"> function is_serialized_string( $data ) {
</span><del>- // if it isn't a string, it isn't a serialized string
</del><ins>+ // if it isn't a string, it isn't a serialized string.
</ins><span class="cx"> if ( ! is_string( $data ) ) {
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="lines">@@ -354,7 +369,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.0.5
</span><span class="cx"> *
</span><del>- * @param mixed $data Data that might be serialized.
</del><ins>+ * @param string|array|object $data Data that might be serialized.
</ins><span class="cx"> * @return mixed A scalar data
</span><span class="cx"> */
</span><span class="cx"> function maybe_serialize( $data ) {
</span><span class="lines">@@ -377,7 +392,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 0.71
</span><span class="cx"> *
</span><del>- * @global string $post_default_title Default XMLRPC post title.
</del><ins>+ * @global string $post_default_title Default XML-RPC post title.
</ins><span class="cx"> *
</span><span class="cx"> * @param string $content XMLRPC XML Request content
</span><span class="cx"> * @return string Post title
</span><span class="lines">@@ -401,7 +416,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 0.71
</span><span class="cx"> *
</span><del>- * @global string $post_default_category Default XMLRPC post category.
</del><ins>+ * @global string $post_default_category Default XML-RPC post category.
</ins><span class="cx"> *
</span><span class="cx"> * @param string $content XMLRPC XML Request content
</span><span class="cx"> * @return string|array List of categories or category name.
</span><span class="lines">@@ -422,7 +437,7 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 0.71
</span><span class="cx"> *
</span><del>- * @param string $content XMLRPC XML Request content
</del><ins>+ * @param string $content XML-RPC XML Request content.
</ins><span class="cx"> * @return string XMLRPC XML Request content without title and category elements.
</span><span class="cx"> */
</span><span class="cx"> function xmlrpc_removepostdata( $content ) {
</span><span class="lines">@@ -433,12 +448,12 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * Use RegEx to extract URLs from arbitrary content
</del><ins>+ * Use RegEx to extract URLs from arbitrary content.
</ins><span class="cx"> *
</span><span class="cx"> * @since 3.7.0
</span><span class="cx"> *
</span><del>- * @param string $content
- * @return array URLs found in passed string
</del><ins>+ * @param string $content Content to extract URLs from.
+ * @return array URLs found in passed string.
</ins><span class="cx"> */
</span><span class="cx"> function wp_extract_urls( $content ) {
</span><span class="cx"> preg_match_all(
</span><span class="lines">@@ -472,10 +487,10 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 1.5.0
</span><span class="cx"> *
</span><del>- * @uses $wpdb
</del><ins>+ * @see $wpdb
</ins><span class="cx"> *
</span><del>- * @param string $content Post Content
- * @param int $post_ID Post ID
</del><ins>+ * @param string $content Post Content.
+ * @param int $post_ID Post ID.
</ins><span class="cx"> */
</span><span class="cx"> function do_enclose( $content, $post_ID ) {
</span><span class="cx"> global $wpdb;
</span><span class="lines">@@ -548,9 +563,10 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.5.0
</span><span class="cx"> *
</span><del>- * @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.
</del><ins>+ * @param string $url URL to fetch.
+ * @param string|bool $file_path Optional. File path to write request to. Default false.
+ * @param int $red Optional. The number of Redirects followed, Upon 5 being hit,
+ * returns false. Default 1.
</ins><span class="cx"> * @return bool|string False on failure and string of headers if HEAD request.
</span><span class="cx"> */
</span><span class="cx"> function wp_get_http( $url, $file_path = false, $red = 1 ) {
</span><span class="lines">@@ -600,8 +616,8 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 1.5.1
</span><span class="cx"> *
</span><del>- * @param string $url
- * @param bool $deprecated Not Used.
</del><ins>+ * @param string $url URL to retrieve HTTP headers from.
+ * @param bool $deprecated Not Used.
</ins><span class="cx"> * @return bool|string False on failure, headers on success.
</span><span class="cx"> */
</span><span class="cx"> function wp_get_http_headers( $url, $deprecated = false ) {
</span><span class="lines">@@ -621,6 +637,7 @@
</span><span class="cx"> * publish date of the previous post in the loop.
</span><span class="cx"> *
</span><span class="cx"> * @since 0.71
</span><ins>+ *
</ins><span class="cx"> * @global string $currentday The day of the current post in the loop.
</span><span class="cx"> * @global string $previousday The day of the previous post in the loop.
</span><span class="cx"> *
</span></span></pre>
</div>
</div>
</body>
</html>