Changeset 54929
- Timestamp:
- 12/03/2022 03:05:41 PM (2 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r54927 r54929 5034 5034 * @since 2.2.1 5035 5035 * 5036 * @param string $input 5037 * @param array $result Variables will be stored in this array.5038 */ 5039 function wp_parse_str( $input , &$result ) {5040 parse_str( (string) $input , $result );5036 * @param string $input_string The string to be parsed. 5037 * @param array $result Variables will be stored in this array. 5038 */ 5039 function wp_parse_str( $input_string, &$result ) { 5040 parse_str( (string) $input_string, $result ); 5041 5041 5042 5042 /** -
trunk/src/wp-includes/functions.php
r54896 r54929 1268 1268 * @since 5.5.0 Non-string values are left untouched. 1269 1269 * 1270 * @param array $ array Array to walk while sanitizing contents.1271 * @return array Sanitized $ array.1272 */ 1273 function add_magic_quotes( $ array ) {1274 foreach ( (array) $ array as $k => $v ) {1270 * @param array $input_array Array to walk while sanitizing contents. 1271 * @return array Sanitized $input_array. 1272 */ 1273 function add_magic_quotes( $input_array ) { 1274 foreach ( (array) $input_array as $k => $v ) { 1275 1275 if ( is_array( $v ) ) { 1276 $ array[ $k ] = add_magic_quotes( $v );1276 $input_array[ $k ] = add_magic_quotes( $v ); 1277 1277 } elseif ( is_string( $v ) ) { 1278 $ array[ $k ] = addslashes( $v );1278 $input_array[ $k ] = addslashes( $v ); 1279 1279 } else { 1280 1280 continue; … … 1282 1282 } 1283 1283 1284 return $ array;1284 return $input_array; 1285 1285 } 1286 1286 … … 1868 1868 * @param string $name Optional. Nonce name. Default '_wpnonce'. 1869 1869 * @param bool $referer Optional. Whether to set the referer field for validation. Default true. 1870 * @param bool $ echoOptional. Whether to display or return hidden form field. Default true.1870 * @param bool $display Optional. Whether to display or return hidden form field. Default true. 1871 1871 * @return string Nonce field HTML markup. 1872 1872 */ 1873 function wp_nonce_field( $action = -1, $name = '_wpnonce', $referer = true, $ echo= true ) {1873 function wp_nonce_field( $action = -1, $name = '_wpnonce', $referer = true, $display = true ) { 1874 1874 $name = esc_attr( $name ); 1875 1875 $nonce_field = '<input type="hidden" id="' . $name . '" name="' . $name . '" value="' . wp_create_nonce( $action ) . '" />'; … … 1879 1879 } 1880 1880 1881 if ( $ echo) {1881 if ( $display ) { 1882 1882 echo $nonce_field; 1883 1883 } … … 1894 1894 * @since 2.0.4 1895 1895 * 1896 * @param bool $ echoOptional. Whether to echo or return the referer field. Default true.1896 * @param bool $display Optional. Whether to echo or return the referer field. Default true. 1897 1897 * @return string Referer field HTML markup. 1898 1898 */ 1899 function wp_referer_field( $ echo= true ) {1899 function wp_referer_field( $display = true ) { 1900 1900 $request_url = remove_query_arg( '_wp_http_referer' ); 1901 1901 $referer_field = '<input type="hidden" name="_wp_http_referer" value="' . esc_url( $request_url ) . '" />'; 1902 1902 1903 if ( $ echo) {1903 if ( $display ) { 1904 1904 echo $referer_field; 1905 1905 } … … 1917 1917 * @since 2.0.4 1918 1918 * 1919 * @param bool $ echoOptional. Whether to echo the original http referer. Default true.1919 * @param bool $display Optional. Whether to echo the original http referer. Default true. 1920 1920 * @param string $jump_back_to Optional. Can be 'previous' or page you want to jump back to. 1921 1921 * Default 'current'. 1922 1922 * @return string Original referer field. 1923 1923 */ 1924 function wp_original_referer_field( $ echo= true, $jump_back_to = 'current' ) {1924 function wp_original_referer_field( $display = true, $jump_back_to = 'current' ) { 1925 1925 $ref = wp_get_original_referer(); 1926 1926 … … 1931 1931 $orig_referer_field = '<input type="hidden" name="_wp_original_http_referer" value="' . esc_attr( $ref ) . '" />'; 1932 1932 1933 if ( $ echo) {1933 if ( $display ) { 1934 1934 echo $orig_referer_field; 1935 1935 } … … 4337 4337 * @see _wp_json_sanity_check() 4338 4338 * 4339 * @param string $ string The string which is to be converted.4339 * @param string $input_string The string which is to be converted. 4340 4340 * @return string The checked string. 4341 4341 */ 4342 function _wp_json_convert_string( $ string ) {4342 function _wp_json_convert_string( $input_string ) { 4343 4343 static $use_mb = null; 4344 4344 if ( is_null( $use_mb ) ) { … … 4347 4347 4348 4348 if ( $use_mb ) { 4349 $encoding = mb_detect_encoding( $ string, mb_detect_order(), true );4349 $encoding = mb_detect_encoding( $input_string, mb_detect_order(), true ); 4350 4350 if ( $encoding ) { 4351 return mb_convert_encoding( $ string, 'UTF-8', $encoding );4351 return mb_convert_encoding( $input_string, 'UTF-8', $encoding ); 4352 4352 } else { 4353 return mb_convert_encoding( $ string, 'UTF-8', 'UTF-8' );4353 return mb_convert_encoding( $input_string, 'UTF-8', 'UTF-8' ); 4354 4354 } 4355 4355 } else { 4356 return wp_check_invalid_utf8( $ string, true );4356 return wp_check_invalid_utf8( $input_string, true ); 4357 4357 } 4358 4358 } … … 4812 4812 * @since 5.1.0 4813 4813 * 4814 * @param array|string $ list List of values.4814 * @param array|string $input_list List of values. 4815 4815 * @return array Array of values. 4816 4816 */ 4817 function wp_parse_list( $ list ) {4818 if ( ! is_array( $ list ) ) {4819 return preg_split( '/[\s,]+/', $ list, -1, PREG_SPLIT_NO_EMPTY );4817 function wp_parse_list( $input_list ) { 4818 if ( ! is_array( $input_list ) ) { 4819 return preg_split( '/[\s,]+/', $input_list, -1, PREG_SPLIT_NO_EMPTY ); 4820 4820 } 4821 4821 4822 4822 // Validate all entries of the list are scalar. 4823 $ list = array_filter( $list, 'is_scalar' );4824 4825 return $ list;4823 $input_list = array_filter( $input_list, 'is_scalar' ); 4824 4825 return $input_list; 4826 4826 } 4827 4827 … … 4832 4832 * @since 5.1.0 Refactored to use wp_parse_list(). 4833 4833 * 4834 * @param array|string $ list List of IDs.4834 * @param array|string $input_list List of IDs. 4835 4835 * @return int[] Sanitized array of IDs. 4836 4836 */ 4837 function wp_parse_id_list( $ list ) {4838 $ list = wp_parse_list( $list );4839 4840 return array_unique( array_map( 'absint', $ list ) );4837 function wp_parse_id_list( $input_list ) { 4838 $input_list = wp_parse_list( $input_list ); 4839 4840 return array_unique( array_map( 'absint', $input_list ) ); 4841 4841 } 4842 4842 … … 4847 4847 * @since 5.1.0 Refactored to use wp_parse_list(). 4848 4848 * 4849 * @param array|string $ list List of slugs.4849 * @param array|string $input_list List of slugs. 4850 4850 * @return string[] Sanitized array of slugs. 4851 4851 */ 4852 function wp_parse_slug_list( $ list ) {4853 $ list = wp_parse_list( $list );4854 4855 return array_unique( array_map( 'sanitize_title', $ list ) );4852 function wp_parse_slug_list( $input_list ) { 4853 $input_list = wp_parse_list( $input_list ); 4854 4855 return array_unique( array_map( 'sanitize_title', $input_list ) ); 4856 4856 } 4857 4857 … … 4861 4861 * @since 3.1.0 4862 4862 * 4863 * @param array $ array The original array.4864 * @param array $keys The list of keys.4863 * @param array $input_array The original array. 4864 * @param array $keys The list of keys. 4865 4865 * @return array The array slice. 4866 4866 */ 4867 function wp_array_slice_assoc( $ array, $keys ) {4867 function wp_array_slice_assoc( $input_array, $keys ) { 4868 4868 $slice = array(); 4869 4869 4870 4870 foreach ( $keys as $key ) { 4871 if ( isset( $ array[ $key ] ) ) {4872 $slice[ $key ] = $ array[ $key ];4871 if ( isset( $input_array[ $key ] ) ) { 4872 $slice[ $key ] = $input_array[ $key ]; 4873 4873 } 4874 4874 } … … 4885 4885 * Example usage: 4886 4886 * 4887 * $ array = array(4887 * $input_array = array( 4888 4888 * 'a' => array( 4889 4889 * 'b' => array( … … 4892 4892 * ), 4893 4893 * ); 4894 * _wp_array_get( $ array, array( 'a', 'b', 'c' ) );4894 * _wp_array_get( $input_array, array( 'a', 'b', 'c' ) ); 4895 4895 * 4896 4896 * @internal … … 4899 4899 * @access private 4900 4900 * 4901 * @param array $ array An array from which we want to retrieve some information.4902 * @param array $path An array of keys describing the path with which to retrieve information.4903 * @param mixed $default Optional. The return value if the path does not exist within the array,4904 * or if `$array` or `$path` are not arrays. Default null.4901 * @param array $input_array An array from which we want to retrieve some information. 4902 * @param array $path An array of keys describing the path with which to retrieve information. 4903 * @param mixed $default_value Optional. The return value if the path does not exist within the array, 4904 * or if `$input_array` or `$path` are not arrays. Default null. 4905 4905 * @return mixed The value from the path specified. 4906 4906 */ 4907 function _wp_array_get( $ array, $path, $default= null ) {4907 function _wp_array_get( $input_array, $path, $default_value = null ) { 4908 4908 // Confirm $path is valid. 4909 4909 if ( ! is_array( $path ) || 0 === count( $path ) ) { 4910 return $default ;4910 return $default_value; 4911 4911 } 4912 4912 4913 4913 foreach ( $path as $path_element ) { 4914 4914 if ( 4915 ! is_array( $ array ) ||4915 ! is_array( $input_array ) || 4916 4916 ( ! is_string( $path_element ) && ! is_integer( $path_element ) && ! is_null( $path_element ) ) || 4917 ! array_key_exists( $path_element, $ array )4917 ! array_key_exists( $path_element, $input_array ) 4918 4918 ) { 4919 return $default ;4920 } 4921 $ array = $array[ $path_element ];4922 } 4923 4924 return $ array;4919 return $default_value; 4920 } 4921 $input_array = $input_array[ $path_element ]; 4922 } 4923 4924 return $input_array; 4925 4925 } 4926 4926 … … 4933 4933 * Example usage: 4934 4934 * 4935 * $ array = array();4936 * _wp_array_set( $ array, array( 'a', 'b', 'c', 1 ) );4937 * 4938 * $ array becomes:4935 * $input_array = array(); 4936 * _wp_array_set( $input_array, array( 'a', 'b', 'c', 1 ) ); 4937 * 4938 * $input_array becomes: 4939 4939 * array( 4940 4940 * 'a' => array( … … 4950 4950 * @access private 4951 4951 * 4952 * @param array $ array An array that we want to mutate to include a specific value in a path.4953 * @param array $path An array of keys describing the path that we want to mutate.4954 * @param mixed $value The value that will be set.4955 */ 4956 function _wp_array_set( &$ array, $path, $value = null ) {4957 // Confirm $ array is valid.4958 if ( ! is_array( $ array ) ) {4952 * @param array $input_array An array that we want to mutate to include a specific value in a path. 4953 * @param array $path An array of keys describing the path that we want to mutate. 4954 * @param mixed $value The value that will be set. 4955 */ 4956 function _wp_array_set( &$input_array, $path, $value = null ) { 4957 // Confirm $input_array is valid. 4958 if ( ! is_array( $input_array ) ) { 4959 4959 return; 4960 4960 } … … 4983 4983 $path_element = $path[ $i ]; 4984 4984 if ( 4985 ! array_key_exists( $path_element, $ array ) ||4986 ! is_array( $ array[ $path_element ] )4985 ! array_key_exists( $path_element, $input_array ) || 4986 ! is_array( $input_array[ $path_element ] ) 4987 4987 ) { 4988 $ array[ $path_element ] = array();4989 } 4990 $ array = &$array[ $path_element ]; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.VariableRedeclaration4991 } 4992 4993 $ array[ $path[ $i ] ] = $value;4988 $input_array[ $path_element ] = array(); 4989 } 4990 $input_array = &$input_array[ $path_element ]; // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.VariableRedeclaration 4991 } 4992 4993 $input_array[ $path[ $i ] ] = $value; 4994 4994 } 4995 4995 … … 5015 5015 * @link https://github.com/lodash-php/lodash-php/blob/master/src/internal/unicodeWords.php 5016 5016 * 5017 * @param string $ string The string to kebab-case.5017 * @param string $input_string The string to kebab-case. 5018 5018 * 5019 5019 * @return string kebab-cased-string. 5020 5020 */ 5021 function _wp_to_kebab_case( $ string ) {5021 function _wp_to_kebab_case( $input_string ) { 5022 5022 //phpcs:disable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase 5023 5023 // ignore the camelCase names for variables so the names are the same as lodash … … 5066 5066 ) . '/u'; 5067 5067 5068 preg_match_all( $regexp, str_replace( "'", '', $ string ), $matches );5068 preg_match_all( $regexp, str_replace( "'", '', $input_string ), $matches ); 5069 5069 return strtolower( implode( '-', $matches[0] ) ); 5070 5070 //phpcs:enable WordPress.NamingConventions.ValidVariableName.VariableNotSnakeCase … … 5107 5107 * @since 4.7.0 Uses `WP_List_Util` class. 5108 5108 * 5109 * @param array $ listAn array of objects to filter.5110 * @param array $args Optional. An array of key => value arguments to match5111 * against each object. Default empty array.5112 * @param string $operator Optional. The logical operation to perform. 'AND' means5113 * all elements from the array must match. 'OR' means only5114 * one element needs to match. 'NOT' means no elements may5115 * match. Default 'AND'.5116 * @param bool|string $field Optional. A field from the object to place instead5117 * of the entire object. Default false.5109 * @param array $input_list An array of objects to filter. 5110 * @param array $args Optional. An array of key => value arguments to match 5111 * against each object. Default empty array. 5112 * @param string $operator Optional. The logical operation to perform. 'AND' means 5113 * all elements from the array must match. 'OR' means only 5114 * one element needs to match. 'NOT' means no elements may 5115 * match. Default 'AND'. 5116 * @param bool|string $field Optional. A field from the object to place instead 5117 * of the entire object. Default false. 5118 5118 * @return array A list of objects or object fields. 5119 5119 */ 5120 function wp_filter_object_list( $ list, $args = array(), $operator = 'and', $field = false ) {5121 if ( ! is_array( $ list ) ) {5120 function wp_filter_object_list( $input_list, $args = array(), $operator = 'and', $field = false ) { 5121 if ( ! is_array( $input_list ) ) { 5122 5122 return array(); 5123 5123 } 5124 5124 5125 $util = new WP_List_Util( $ list );5125 $util = new WP_List_Util( $input_list ); 5126 5126 5127 5127 $util->filter( $args, $operator ); … … 5151 5151 * @since 5.9.0 Converted into a wrapper for `wp_filter_object_list()`. 5152 5152 * 5153 * @param array $ listAn array of objects to filter.5154 * @param array $args Optional. An array of key => value arguments to match5155 * against each object. Default empty array.5156 * @param string $operator Optional. The logical operation to perform. 'AND' means5157 * all elements from the array must match. 'OR' means only5158 * one element needs to match. 'NOT' means no elements may5159 * match. Default 'AND'.5153 * @param array $input_list An array of objects to filter. 5154 * @param array $args Optional. An array of key => value arguments to match 5155 * against each object. Default empty array. 5156 * @param string $operator Optional. The logical operation to perform. 'AND' means 5157 * all elements from the array must match. 'OR' means only 5158 * one element needs to match. 'NOT' means no elements may 5159 * match. Default 'AND'. 5160 5160 * @return array Array of found values. 5161 5161 */ 5162 function wp_list_filter( $ list, $args = array(), $operator = 'AND' ) {5163 return wp_filter_object_list( $ list, $args, $operator );5162 function wp_list_filter( $input_list, $args = array(), $operator = 'AND' ) { 5163 return wp_filter_object_list( $input_list, $args, $operator ); 5164 5164 } 5165 5165 … … 5174 5174 * @since 4.7.0 Uses `WP_List_Util` class. 5175 5175 * 5176 * @param array $ listList of objects or arrays.5177 * @param int|string $field Field from the object to place instead of the entire object.5178 * @param int|string $index_key Optional. Field from the object to use as keys for the new array.5179 * Default null.5176 * @param array $input_list List of objects or arrays. 5177 * @param int|string $field Field from the object to place instead of the entire object. 5178 * @param int|string $index_key Optional. Field from the object to use as keys for the new array. 5179 * Default null. 5180 5180 * @return array Array of found values. If `$index_key` is set, an array of found values with keys 5181 5181 * corresponding to `$index_key`. If `$index_key` is null, array keys from the original 5182 * `$ list` will be preserved in the results.5183 */ 5184 function wp_list_pluck( $ list, $field, $index_key = null ) {5185 if ( ! is_array( $ list ) ) {5182 * `$input_list` will be preserved in the results. 5183 */ 5184 function wp_list_pluck( $input_list, $field, $index_key = null ) { 5185 if ( ! is_array( $input_list ) ) { 5186 5186 return array(); 5187 5187 } 5188 5188 5189 $util = new WP_List_Util( $ list );5189 $util = new WP_List_Util( $input_list ); 5190 5190 5191 5191 return $util->pluck( $field, $index_key ); … … 5197 5197 * @since 4.7.0 5198 5198 * 5199 * @param array $ listAn array of objects or arrays to sort.5199 * @param array $input_list An array of objects or arrays to sort. 5200 5200 * @param string|array $orderby Optional. Either the field name to order by or an array 5201 5201 * of multiple orderby fields as `$orderby => $order`. … … 5206 5206 * @return array The sorted array. 5207 5207 */ 5208 function wp_list_sort( $ list, $orderby = array(), $order = 'ASC', $preserve_keys = false ) {5209 if ( ! is_array( $ list ) ) {5208 function wp_list_sort( $input_list, $orderby = array(), $order = 'ASC', $preserve_keys = false ) { 5209 if ( ! is_array( $input_list ) ) { 5210 5210 return array(); 5211 5211 } 5212 5212 5213 $util = new WP_List_Util( $ list );5213 $util = new WP_List_Util( $input_list ); 5214 5214 5215 5215 return $util->sort( $orderby, $order, $preserve_keys ); … … 5349 5349 * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE). 5350 5350 * 5351 * @param string $function 5352 * @param string $version The version of WordPress that deprecated the function.5353 * @param string $replacement Optional. The function that should have been called. Default empty.5354 */ 5355 function _deprecated_function( $function , $version, $replacement = '' ) {5351 * @param string $function_name The function that was called. 5352 * @param string $version The version of WordPress that deprecated the function. 5353 * @param string $replacement Optional. The function that should have been called. Default empty. 5354 */ 5355 function _deprecated_function( $function_name, $version, $replacement = '' ) { 5356 5356 5357 5357 /** … … 5360 5360 * @since 2.5.0 5361 5361 * 5362 * @param string $function 5363 * @param string $replacement The function that should have been called.5364 * @param string $version The version of WordPress that deprecated the function.5362 * @param string $function_name The function that was called. 5363 * @param string $replacement The function that should have been called. 5364 * @param string $version The version of WordPress that deprecated the function. 5365 5365 */ 5366 do_action( 'deprecated_function_run', $function , $replacement, $version );5366 do_action( 'deprecated_function_run', $function_name, $replacement, $version ); 5367 5367 5368 5368 /** … … 5380 5380 /* translators: 1: PHP function name, 2: Version number, 3: Alternative function name. */ 5381 5381 __( 'Function %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), 5382 $function ,5382 $function_name, 5383 5383 $version, 5384 5384 $replacement … … 5391 5391 /* translators: 1: PHP function name, 2: Version number. */ 5392 5392 __( 'Function %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.' ), 5393 $function ,5393 $function_name, 5394 5394 $version 5395 5395 ), … … 5402 5402 sprintf( 5403 5403 'Function %1$s is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', 5404 $function ,5404 $function_name, 5405 5405 $version, 5406 5406 $replacement … … 5412 5412 sprintf( 5413 5413 'Function %1$s is <strong>deprecated</strong> since version %2$s with no alternative available.', 5414 $function ,5414 $function_name, 5415 5415 $version 5416 5416 ), … … 5437 5437 * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE). 5438 5438 * 5439 * @param string $class 5439 * @param string $class_name The class containing the deprecated constructor. 5440 5440 * @param string $version The version of WordPress that deprecated the function. 5441 5441 * @param string $parent_class Optional. The parent class calling the deprecated constructor. 5442 5442 * Default empty string. 5443 5443 */ 5444 function _deprecated_constructor( $class , $version, $parent_class = '' ) {5444 function _deprecated_constructor( $class_name, $version, $parent_class = '' ) { 5445 5445 5446 5446 /** … … 5450 5450 * @since 4.5.0 Added the `$parent_class` parameter. 5451 5451 * 5452 * @param string $class 5452 * @param string $class_name The class containing the deprecated constructor. 5453 5453 * @param string $version The version of WordPress that deprecated the function. 5454 5454 * @param string $parent_class The parent class calling the deprecated constructor. 5455 5455 */ 5456 do_action( 'deprecated_constructor_run', $class , $version, $parent_class );5456 do_action( 'deprecated_constructor_run', $class_name, $version, $parent_class ); 5457 5457 5458 5458 /** … … 5472 5472 /* translators: 1: PHP class name, 2: PHP parent class name, 3: Version number, 4: __construct() method. */ 5473 5473 __( 'The called constructor method for %1$s class in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.' ), 5474 $class ,5474 $class_name, 5475 5475 $parent_class, 5476 5476 $version, … … 5484 5484 /* translators: 1: PHP class name, 2: Version number, 3: __construct() method. */ 5485 5485 __( 'The called constructor method for %1$s class is <strong>deprecated</strong> since version %2$s! Use %3$s instead.' ), 5486 $class ,5486 $class_name, 5487 5487 $version, 5488 5488 '<code>__construct()</code>' … … 5496 5496 sprintf( 5497 5497 'The called constructor method for %1$s class in %2$s is <strong>deprecated</strong> since version %3$s! Use %4$s instead.', 5498 $class ,5498 $class_name, 5499 5499 $parent_class, 5500 5500 $version, … … 5507 5507 sprintf( 5508 5508 'The called constructor method for %1$s class is <strong>deprecated</strong> since version %2$s! Use %3$s instead.', 5509 $class ,5509 $class_name, 5510 5510 $version, 5511 5511 '<code>__construct()</code>' … … 5633 5633 * @since 5.4.0 The error type is now classified as E_USER_DEPRECATED (used to default to E_USER_NOTICE). 5634 5634 * 5635 * @param string $function The function that was called.5636 * @param string $version The version of WordPress that deprecated the argument used.5637 * @param string $message Optional. A message regarding the change. Default empty.5638 */ 5639 function _deprecated_argument( $function , $version, $message = '' ) {5635 * @param string $function_name The function that was called. 5636 * @param string $version The version of WordPress that deprecated the argument used. 5637 * @param string $message Optional. A message regarding the change. Default empty. 5638 */ 5639 function _deprecated_argument( $function_name, $version, $message = '' ) { 5640 5640 5641 5641 /** … … 5644 5644 * @since 3.0.0 5645 5645 * 5646 * @param string $function The function that was called.5647 * @param string $message A message regarding the change.5648 * @param string $version The version of WordPress that deprecated the argument used.5646 * @param string $function_name The function that was called. 5647 * @param string $message A message regarding the change. 5648 * @param string $version The version of WordPress that deprecated the argument used. 5649 5649 */ 5650 do_action( 'deprecated_argument_run', $function , $message, $version );5650 do_action( 'deprecated_argument_run', $function_name, $message, $version ); 5651 5651 5652 5652 /** … … 5664 5664 /* translators: 1: PHP function name, 2: Version number, 3: Optional message regarding the change. */ 5665 5665 __( 'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s' ), 5666 $function ,5666 $function_name, 5667 5667 $version, 5668 5668 $message … … 5675 5675 /* translators: 1: PHP function name, 2: Version number. */ 5676 5676 __( 'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.' ), 5677 $function ,5677 $function_name, 5678 5678 $version 5679 5679 ), … … 5686 5686 sprintf( 5687 5687 'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s! %3$s', 5688 $function ,5688 $function_name, 5689 5689 $version, 5690 5690 $message … … 5696 5696 sprintf( 5697 5697 'Function %1$s was called with an argument that is <strong>deprecated</strong> since version %2$s with no alternative available.', 5698 $function ,5698 $function_name, 5699 5699 $version 5700 5700 ), … … 5787 5787 * @since 5.4.0 This function is no longer marked as "private". 5788 5788 * 5789 * @param string $function The function that was called.5790 * @param string $message A message explaining what has been done incorrectly.5791 * @param string $version The version of WordPress where the message was added.5792 */ 5793 function _doing_it_wrong( $function , $message, $version ) {5789 * @param string $function_name The function that was called. 5790 * @param string $message A message explaining what has been done incorrectly. 5791 * @param string $version The version of WordPress where the message was added. 5792 */ 5793 function _doing_it_wrong( $function_name, $message, $version ) { 5794 5794 5795 5795 /** … … 5798 5798 * @since 3.1.0 5799 5799 * 5800 * @param string $function The function that was called.5801 * @param string $message A message explaining what has been done incorrectly.5802 * @param string $version The version of WordPress where the message was added.5800 * @param string $function_name The function that was called. 5801 * @param string $message A message explaining what has been done incorrectly. 5802 * @param string $version The version of WordPress where the message was added. 5803 5803 */ 5804 do_action( 'doing_it_wrong_run', $function , $message, $version );5804 do_action( 'doing_it_wrong_run', $function_name, $message, $version ); 5805 5805 5806 5806 /** … … 5808 5808 * 5809 5809 * @since 3.1.0 5810 * @since 5.1.0 Added the $function , $message and $version parameters.5811 * 5812 * @param bool $trigger Whether to trigger the error for _doing_it_wrong() calls. Default true.5813 * @param string $function The function that was called.5814 * @param string $message A message explaining what has been done incorrectly.5815 * @param string $version The version of WordPress where the message was added.5810 * @since 5.1.0 Added the $function_name, $message and $version parameters. 5811 * 5812 * @param bool $trigger Whether to trigger the error for _doing_it_wrong() calls. Default true. 5813 * @param string $function_name The function that was called. 5814 * @param string $message A message explaining what has been done incorrectly. 5815 * @param string $version The version of WordPress where the message was added. 5816 5816 */ 5817 if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true, $function , $message, $version ) ) {5817 if ( WP_DEBUG && apply_filters( 'doing_it_wrong_trigger_error', true, $function_name, $message, $version ) ) { 5818 5818 if ( function_exists( '__' ) ) { 5819 5819 if ( $version ) { … … 5832 5832 /* translators: Developer debugging message. 1: PHP function name, 2: Explanatory message, 3: WordPress version number. */ 5833 5833 __( 'Function %1$s was called <strong>incorrectly</strong>. %2$s %3$s' ), 5834 $function ,5834 $function_name, 5835 5835 $message, 5836 5836 $version … … 5851 5851 sprintf( 5852 5852 'Function %1$s was called <strong>incorrectly</strong>. %2$s %3$s', 5853 $function ,5853 $function_name, 5854 5854 $message, 5855 5855 $version … … 5882 5882 * @global bool $is_apache 5883 5883 * 5884 * @param string $mod The module, e.g. mod_rewrite.5885 * @param bool $default Optional. The default return value if the module is not found. Default false.5884 * @param string $mod The module, e.g. mod_rewrite. 5885 * @param bool $default_value Optional. The default return value if the module is not found. Default false. 5886 5886 * @return bool Whether the specified module is loaded. 5887 5887 */ 5888 function apache_mod_loaded( $mod, $default = false ) {5888 function apache_mod_loaded( $mod, $default_value = false ) { 5889 5889 global $is_apache; 5890 5890 … … 5916 5916 } 5917 5917 5918 return $default ;5918 return $default_value; 5919 5919 } 5920 5920 … … 7289 7289 * Filters/validates a variable as a boolean. 7290 7290 * 7291 * Alternative to `filter_var( $va r, FILTER_VALIDATE_BOOLEAN )`.7291 * Alternative to `filter_var( $value, FILTER_VALIDATE_BOOLEAN )`. 7292 7292 * 7293 7293 * @since 4.0.0 7294 7294 * 7295 * @param mixed $va rBoolean value to validate.7295 * @param mixed $value Boolean value to validate. 7296 7296 * @return bool Whether the value is validated. 7297 7297 */ 7298 function wp_validate_boolean( $va r) {7299 if ( is_bool( $va r) ) {7300 return $va r;7301 } 7302 7303 if ( is_string( $va r ) && 'false' === strtolower( $var) ) {7298 function wp_validate_boolean( $value ) { 7299 if ( is_bool( $value ) ) { 7300 return $value; 7301 } 7302 7303 if ( is_string( $value ) && 'false' === strtolower( $value ) ) { 7304 7304 return false; 7305 7305 } 7306 7306 7307 return (bool) $va r;7307 return (bool) $value; 7308 7308 } 7309 7309
Note: See TracChangeset
for help on using the changeset viewer.