X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/f5fcdc7994bb67cce809bc4777944ae8b7fad4a4..53f4633144ed68c8b8fb5861f992b5489894a940:/wp-includes/functions.php diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 929c4e21..30fac474 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -78,6 +78,8 @@ function current_time( $type, $gmt = 0 ) { * * @since 0.71 * + * @global WP_Locale $wp_locale + * * @param string $dateformatstring Format to display the date. * @param bool|int $unixtimestamp Optional. Unix timestamp. Default false. * @param bool $gmt Optional. Whether to use GMT timezone. Default false. @@ -161,6 +163,8 @@ function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) { * * @since 2.3.0 * + * @global WP_Locale $wp_locale + * * @param int $number The number to convert based on locale. * @param int $decimals Optional. Precision of the number of decimal places. Default 0. * @return string Converted number in string format. @@ -381,6 +385,7 @@ function maybe_serialize( $data ) { // Double serialization is required for backward compatibility. // See https://core.trac.wordpress.org/ticket/12930 + // Also the world will end. See WP 3.6.1. if ( is_serialized( $data, false ) ) return serialize( $data ); @@ -490,10 +495,10 @@ function wp_extract_urls( $content ) { * * @since 1.5.0 * - * @see $wpdb + * @global wpdb $wpdb * * @param string $content Post Content. - * @param int $post_ID Post ID. + * @param int $post_ID Post ID. */ function do_enclose( $content, $post_ID ) { global $wpdb; @@ -870,6 +875,10 @@ function wp_remote_fopen( $uri ) { * * @since 2.0.0 * + * @global WP $wp_locale + * @global WP_Query $wp_query + * @global WP_Query $wp_the_query + * * @param string|array $query_vars Default WP_Query arguments. */ function wp( $query_vars = '' ) { @@ -885,6 +894,8 @@ function wp( $query_vars = '' ) { * * @since 2.3.0 * + * @global array $wp_header_to_desc + * * @param int $code HTTP status code. * @return string Empty string if not found, or description if found. */ @@ -1124,7 +1135,7 @@ function bool_from_yn( $yn ) { * * @since 2.1.0 * - * @uses $wp_query Used to tell if the use a comment feed. + * @global WP_Query $wp_query Used to tell if the use a comment feed. */ function do_feed() { global $wp_query; @@ -1473,7 +1484,7 @@ function wp_mkdir_p( $target ) { $wrapper = null; // Strip the protocol. - if( wp_is_stream( $target ) ) { + if ( wp_is_stream( $target ) ) { list( $wrapper, $target ) = explode( '://', $target, 2 ); } @@ -1481,7 +1492,7 @@ function wp_mkdir_p( $target ) { $target = str_replace( '//', '/', $target ); // Put the wrapper back on the target. - if( $wrapper !== null ) { + if ( $wrapper !== null ) { $target = $wrapper . '://' . $target; } @@ -1605,10 +1616,12 @@ function wp_normalize_path( $path ) { * * @since 2.5.0 * + * @staticvar string $temp + * * @return string Writable temporary directory. */ function get_temp_dir() { - static $temp; + static $temp = ''; if ( defined('WP_TEMP_DIR') ) return trailingslashit(WP_TEMP_DIR); @@ -1629,8 +1642,7 @@ function get_temp_dir() { if ( is_dir( $temp ) && wp_is_writable( $temp ) ) return $temp; - $temp = '/tmp/'; - return $temp; + return '/tmp/'; } /** @@ -2000,8 +2012,7 @@ function wp_upload_bits( $name, $deprecated, $bits, $time = null ) { * @since 2.5.0 * * @param string $ext The extension to search. - * @return string|null The file type, example: audio, video, document, spreadsheet, etc. - * Null if not found. + * @return string|void The file type, example: audio, video, document, spreadsheet, etc. */ function wp_ext2type( $ext ) { $ext = strtolower( $ext ); @@ -2031,8 +2042,6 @@ function wp_ext2type( $ext ) { foreach ( $ext2type as $type => $exts ) if ( in_array( $ext, $exts ) ) return $type; - - return null; } /** @@ -2084,7 +2093,6 @@ function wp_check_filetype( $filename, $mimes = null ) { * if original $filename is valid. */ function wp_check_filetype_and_ext( $file, $filename, $mimes = null ) { - $proper_filename = false; // Do basic extension validation and MIME mapping @@ -2473,6 +2481,7 @@ function _default_wp_die_handler( $message, $title = '', $args = array() ) { > + <?php echo $title ?>