Changeset 51919
- Timestamp:
- 10/18/2021 05:51:17 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-wp-debug-data.php
r51715 r51919 14 14 * @since 5.2.0 15 15 */ 16 static function check_for_updates() {16 public static function check_for_updates() { 17 17 wp_version_check(); 18 18 wp_update_plugins(); … … 33 33 * @return array The debug data for the site. 34 34 */ 35 static function debug_data() {35 public static function debug_data() { 36 36 global $wpdb; 37 37 -
trunk/src/wp-admin/includes/class-wp-site-health-auto-updates.php
r51661 r51919 157 157 * @return array|false The test results. False if the auto-updates failed. 158 158 */ 159 function test_if_failed_update() {159 public function test_if_failed_update() { 160 160 $failed = get_site_option( 'auto_core_update_failed' ); 161 161 … … 273 273 * @return array The test results. 274 274 */ 275 function test_check_wp_filesystem_method() {275 public function test_check_wp_filesystem_method() { 276 276 // Make sure the `request_filesystem_credentials()` function is available during our REST API call. 277 277 if ( ! function_exists( 'request_filesystem_credentials' ) ) { … … 307 307 * @return array|false The test results. False if they're not writeable. 308 308 */ 309 function test_all_files_writable() {309 public function test_all_files_writable() { 310 310 global $wp_filesystem; 311 311 … … 392 392 * @return array|false The test results. False if it isn't a development version. 393 393 */ 394 function test_accepts_dev_updates() {394 public function test_accepts_dev_updates() { 395 395 require ABSPATH . WPINC . '/version.php'; // $wp_version; // x.y.z 396 396 // Only for dev versions. … … 430 430 * @return array The test results. 431 431 */ 432 function test_accepts_minor_updates() {432 public function test_accepts_minor_updates() { 433 433 if ( defined( 'WP_AUTO_UPDATE_CORE' ) && false === WP_AUTO_UPDATE_CORE ) { 434 434 return array( -
trunk/src/wp-admin/includes/class-wp-site-health.php
r51898 r51919 2768 2768 * @return object The test results. 2769 2769 */ 2770 function detect_plugin_theme_auto_update_issues() {2770 public function detect_plugin_theme_auto_update_issues() { 2771 2771 $mock_plugin = (object) array( 2772 2772 'id' => 'w.org/plugins/a-fake-plugin', … … 2851 2851 * @return object The test results. 2852 2852 */ 2853 function can_perform_loopback() {2853 public function can_perform_loopback() { 2854 2854 $body = array( 'site-health' => 'loopback-test' ); 2855 2855 $cookies = wp_unslash( $_COOKIE ); -
trunk/src/wp-content/themes/twentyeleven/inc/widgets.php
r47808 r51919 18 18 * @since Twenty Eleven 2.2 19 19 */ 20 function __construct() {20 public function __construct() { 21 21 parent::__construct( 22 22 'widget_twentyeleven_ephemera', … … 41 41 * @deprecated Twenty Eleven 2.2 42 42 */ 43 function Twenty_Eleven_Ephemera_Widget() {43 public function Twenty_Eleven_Ephemera_Widget() { 44 44 self::__construct(); 45 45 } … … 53 53 * @param array $instance An array of settings for this widget instance. 54 54 */ 55 function widget( $args, $instance ) {55 public function widget( $args, $instance ) { 56 56 $cache = wp_cache_get( 'widget_twentyeleven_ephemera', 'widget' ); 57 57 … … 159 159 * @since Twenty Eleven 1.0 160 160 */ 161 function update( $new_instance, $old_instance ) {161 public function update( $new_instance, $old_instance ) { 162 162 $instance = $old_instance; 163 163 $instance['title'] = strip_tags( $new_instance['title'] ); … … 178 178 * @since Twenty Eleven 1.0 179 179 */ 180 function flush_widget_cache() {180 public function flush_widget_cache() { 181 181 wp_cache_delete( 'widget_twentyeleven_ephemera', 'widget' ); 182 182 } … … 189 189 * @since Twenty Eleven 1.0 190 190 */ 191 function form( $instance ) {191 public function form( $instance ) { 192 192 $title = isset( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 193 193 $number = isset( $instance['number'] ) ? absint( $instance['number'] ) : 10; -
trunk/src/wp-content/themes/twentyfourteen/inc/widgets.php
r51789 r51919 270 270 * @return array Updated widget instance. 271 271 */ 272 function update( $new_instance, $old_instance ) {272 public function update( $new_instance, $old_instance ) { 273 273 $old_instance['title'] = strip_tags( $new_instance['title'] ); 274 274 $old_instance['number'] = empty( $new_instance['number'] ) ? 2 : absint( $new_instance['number'] ); … … 288 288 * @param array $instance 289 289 */ 290 function form( $instance ) {290 public function form( $instance ) { 291 291 $title = ! empty( $instance['title'] ) ? esc_attr( $instance['title'] ) : ''; 292 292 $number = ! empty( $instance['number'] ) ? absint( $instance['number'] ) : 2; -
trunk/src/wp-includes/class-wp-customize-manager.php
r51730 r51919 1186 1186 * @param array $starter_content Starter content. Defaults to `get_theme_starter_content()`. 1187 1187 */ 1188 function import_theme_starter_content( $starter_content = array() ) {1188 public function import_theme_starter_content( $starter_content = array() ) { 1189 1189 if ( empty( $starter_content ) ) { 1190 1190 $starter_content = get_theme_starter_content(); … … 2623 2623 * @return array|WP_Error Returns array on success and WP_Error with array data on error. 2624 2624 */ 2625 function save_changeset_post( $args = array() ) {2625 public function save_changeset_post( $args = array() ) { 2626 2626 2627 2627 $args = array_merge( -
trunk/src/wp-includes/class-wp-customize-setting.php
r51783 r51919 269 269 * @ignore 270 270 */ 271 static public function reset_aggregated_multidimensionals() {271 public static function reset_aggregated_multidimensionals() { 272 272 self::$aggregated_multidimensionals = array(); 273 273 } -
trunk/src/wp-includes/pomo/entry.php
r49184 r51919 41 41 * - flags (array) -- flags like php-format 42 42 */ 43 function __construct( $args = array() ) {43 public function __construct( $args = array() ) { 44 44 // If no singular -- empty object. 45 45 if ( ! isset( $args['singular'] ) ) { … … 81 81 * @return string|bool the key or false if the entry is empty 82 82 */ 83 function key() {83 public function key() { 84 84 if ( null === $this->singular || '' === $this->singular ) { 85 85 return false; … … 97 97 * @param object $other 98 98 */ 99 function merge_with( &$other ) {99 public function merge_with( &$other ) { 100 100 $this->flags = array_unique( array_merge( $this->flags, $other->flags ) ); 101 101 $this->references = array_unique( array_merge( $this->references, $other->references ) ); -
trunk/src/wp-includes/pomo/mo.php
r51342 r51919 38 38 * @return bool True if the import from file was successful, otherwise false. 39 39 */ 40 function import_from_file( $filename ) {40 public function import_from_file( $filename ) { 41 41 $reader = new POMO_FileReader( $filename ); 42 42 … … 54 54 * @return bool 55 55 */ 56 function export_to_file( $filename ) {56 public function export_to_file( $filename ) { 57 57 $fh = fopen( $filename, 'wb' ); 58 58 if ( ! $fh ) { … … 67 67 * @return string|false 68 68 */ 69 function export() {69 public function export() { 70 70 $tmp_fh = fopen( 'php://temp', 'r+' ); 71 71 if ( ! $tmp_fh ) { … … 81 81 * @return bool 82 82 */ 83 function is_entry_good_for_export( $entry ) {83 public function is_entry_good_for_export( $entry ) { 84 84 if ( empty( $entry->translations ) ) { 85 85 return false; … … 97 97 * @return true 98 98 */ 99 function export_to_file_handle( $fh ) {99 public function export_to_file_handle( $fh ) { 100 100 $entries = array_filter( $this->entries, array( $this, 'is_entry_good_for_export' ) ); 101 101 ksort( $entries ); … … 158 158 * @return string 159 159 */ 160 function export_original( $entry ) {160 public function export_original( $entry ) { 161 161 // TODO: Warnings for control characters. 162 162 $exported = $entry->singular; … … 174 174 * @return string 175 175 */ 176 function export_translations( $entry ) {176 public function export_translations( $entry ) { 177 177 // TODO: Warnings for control characters. 178 178 return $entry->is_plural ? implode( "\0", $entry->translations ) : $entry->translations[0]; … … 182 182 * @return string 183 183 */ 184 function export_headers() {184 public function export_headers() { 185 185 $exported = ''; 186 186 foreach ( $this->headers as $header => $value ) { … … 194 194 * @return string|false 195 195 */ 196 function get_byteorder( $magic ) {196 public function get_byteorder( $magic ) { 197 197 // The magic is 0x950412de. 198 198 … … 215 215 * @return bool True if the import was successful, otherwise false. 216 216 */ 217 function import_from_reader( $reader ) {217 public function import_from_reader( $reader ) { 218 218 $endian_string = MO::get_byteorder( $reader->readint32() ); 219 219 if ( false === $endian_string ) { … … 312 312 * @return Translation_Entry Entry instance. 313 313 */ 314 function &make_entry( $original, $translation ) {314 public function &make_entry( $original, $translation ) { 315 315 $entry = new Translation_Entry(); 316 316 // Look for context, separated by \4. … … 336 336 * @return string 337 337 */ 338 function select_plural_form( $count ) {338 public function select_plural_form( $count ) { 339 339 return $this->gettext_select_plural_form( $count ); 340 340 } … … 343 343 * @return int 344 344 */ 345 function get_plural_forms_count() {345 public function get_plural_forms_count() { 346 346 return $this->_nplurals; 347 347 } -
trunk/src/wp-includes/pomo/po.php
r51636 r51919 37 37 * @return string msgid/msgstr PO entry for this PO file headers, doesn't contain newline at the end 38 38 */ 39 function export_headers() {39 public function export_headers() { 40 40 $header_string = ''; 41 41 foreach ( $this->headers as $header => $value ) { … … 56 56 * @return string sequence of mgsgid/msgstr PO strings, doesn't containt newline at the end 57 57 */ 58 function export_entries() {58 public function export_entries() { 59 59 // TODO: Sorting. 60 60 return implode( "\n\n", array_map( array( 'PO', 'export_entry' ), $this->entries ) ); … … 67 67 * @return string ready for inclusion in PO file string for headers and all the enrtries 68 68 */ 69 function export( $include_headers = true ) {69 public function export( $include_headers = true ) { 70 70 $res = ''; 71 71 if ( $include_headers ) { … … 84 84 * @return bool true on success, false on error 85 85 */ 86 function export_to_file( $filename, $include_headers = true ) {86 public function export_to_file( $filename, $include_headers = true ) { 87 87 $fh = fopen( $filename, 'w' ); 88 88 if ( false === $fh ) { … … 104 104 * @param string $text Text to include as a comment. 105 105 */ 106 function set_comment_before_headers( $text ) {106 public function set_comment_before_headers( $text ) { 107 107 $this->comments_before_headers = $text; 108 108 } … … 294 294 * @return bool 295 295 */ 296 function import_from_file( $filename ) {296 public function import_from_file( $filename ) { 297 297 $f = fopen( $filename, 'r' ); 298 298 if ( ! $f ) { … … 336 336 * @return null|false|array 337 337 */ 338 function read_entry( $f, $lineno = 0 ) {338 public function read_entry( $f, $lineno = 0 ) { 339 339 $entry = new Translation_Entry(); 340 340 // Where were we in the last step. … … 465 465 * @return bool 466 466 */ 467 function read_line( $f, $action = 'read' ) {467 public function read_line( $f, $action = 'read' ) { 468 468 static $last_line = ''; 469 469 static $use_last_line = false; … … 487 487 * @param string $po_comment_line 488 488 */ 489 function add_comment_to_entry( &$entry, $po_comment_line ) {489 public function add_comment_to_entry( &$entry, $po_comment_line ) { 490 490 $first_two = substr( $po_comment_line, 0, 2 ); 491 491 $comment = trim( substr( $po_comment_line, 2 ) ); -
trunk/src/wp-includes/pomo/streams.php
r51032 r51919 18 18 * PHP5 constructor. 19 19 */ 20 function __construct() {20 public function __construct() { 21 21 if ( function_exists( 'mb_substr' ) 22 22 && ( (int) ini_get( 'mbstring.func_overload' ) & 2 ) // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated … … 47 47 * @param string $endian Set the endianness of the file. Accepts 'big', or 'little'. 48 48 */ 49 function setEndian( $endian ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid49 public function setEndian( $endian ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid 50 50 $this->endian = $endian; 51 51 } … … 57 57 * the stream of false if there are not enough bytes or on error 58 58 */ 59 function readint32() {59 public function readint32() { 60 60 $bytes = $this->read( 4 ); 61 61 if ( 4 != $this->strlen( $bytes ) ) { … … 74 74 * enough data or on error 75 75 */ 76 function readint32array( $count ) {76 public function readint32array( $count ) { 77 77 $bytes = $this->read( 4 * $count ); 78 78 if ( 4 * $count != $this->strlen( $bytes ) ) { … … 89 89 * @return string 90 90 */ 91 function substr( $string, $start, $length ) {91 public function substr( $string, $start, $length ) { 92 92 if ( $this->is_overloaded ) { 93 93 return mb_substr( $string, $start, $length, 'ascii' ); … … 101 101 * @return int 102 102 */ 103 function strlen( $string ) {103 public function strlen( $string ) { 104 104 if ( $this->is_overloaded ) { 105 105 return mb_strlen( $string, 'ascii' ); … … 114 114 * @return array 115 115 */ 116 function str_split( $string, $chunk_size ) {116 public function str_split( $string, $chunk_size ) { 117 117 if ( ! function_exists( 'str_split' ) ) { 118 118 $length = $this->strlen( $string ); … … 130 130 * @return int 131 131 */ 132 function pos() {132 public function pos() { 133 133 return $this->_pos; 134 134 } … … 137 137 * @return true 138 138 */ 139 function is_resource() {139 public function is_resource() { 140 140 return true; 141 141 } … … 144 144 * @return true 145 145 */ 146 function close() {146 public function close() { 147 147 return true; 148 148 } … … 156 156 * @param string $filename 157 157 */ 158 function __construct( $filename ) {158 public function __construct( $filename ) { 159 159 parent::__construct(); 160 160 $this->_f = fopen( $filename, 'rb' ); … … 177 177 * @return string|false Returns read string, otherwise false. 178 178 */ 179 function read( $bytes ) {179 public function read( $bytes ) { 180 180 return fread( $this->_f, $bytes ); 181 181 } … … 185 185 * @return bool 186 186 */ 187 function seekto( $pos ) {187 public function seekto( $pos ) { 188 188 if ( -1 == fseek( $this->_f, $pos, SEEK_SET ) ) { 189 189 return false; … … 196 196 * @return bool 197 197 */ 198 function is_resource() {198 public function is_resource() { 199 199 return is_resource( $this->_f ); 200 200 } … … 203 203 * @return bool 204 204 */ 205 function feof() {205 public function feof() { 206 206 return feof( $this->_f ); 207 207 } … … 210 210 * @return bool 211 211 */ 212 function close() {212 public function close() { 213 213 return fclose( $this->_f ); 214 214 } … … 217 217 * @return string 218 218 */ 219 function read_all() {219 public function read_all() { 220 220 $all = ''; 221 221 while ( ! $this->feof() ) { … … 239 239 * PHP5 constructor. 240 240 */ 241 function __construct( $str = '' ) {241 public function __construct( $str = '' ) { 242 242 parent::__construct(); 243 243 $this->_str = $str; … … 261 261 * @return string 262 262 */ 263 function read( $bytes ) {263 public function read( $bytes ) { 264 264 $data = $this->substr( $this->_str, $this->_pos, $bytes ); 265 265 $this->_pos += $bytes; … … 274 274 * @return int 275 275 */ 276 function seekto( $pos ) {276 public function seekto( $pos ) { 277 277 $this->_pos = $pos; 278 278 if ( $this->strlen( $this->_str ) < $this->_pos ) { … … 285 285 * @return int 286 286 */ 287 function length() {287 public function length() { 288 288 return $this->strlen( $this->_str ); 289 289 } … … 292 292 * @return string 293 293 */ 294 function read_all() {294 public function read_all() { 295 295 return $this->substr( $this->_str, $this->_pos, $this->strlen( $this->_str ) ); 296 296 } … … 307 307 * PHP5 constructor. 308 308 */ 309 function __construct( $filename ) {309 public function __construct( $filename ) { 310 310 parent::__construct(); 311 311 $this->_str = file_get_contents( $filename ); … … 349 349 * @see POMO_CachedIntFileReader::__construct() 350 350 */ 351 function POMO_CachedIntFileReader( $filename ) {351 public function POMO_CachedIntFileReader( $filename ) { 352 352 _deprecated_constructor( self::class, '5.4.0', static::class ); 353 353 self::__construct( $filename ); -
trunk/src/wp-includes/pomo/translations.php
r49184 r51919 22 22 * @return bool true on success, false if the entry doesn't have a key 23 23 */ 24 function add_entry( $entry ) {24 public function add_entry( $entry ) { 25 25 if ( is_array( $entry ) ) { 26 26 $entry = new Translation_Entry( $entry ); … … 38 38 * @return bool 39 39 */ 40 function add_entry_or_merge( $entry ) {40 public function add_entry_or_merge( $entry ) { 41 41 if ( is_array( $entry ) ) { 42 42 $entry = new Translation_Entry( $entry ); … … 64 64 * @param string $value header value, without trailing \n 65 65 */ 66 function set_header( $header, $value ) {66 public function set_header( $header, $value ) { 67 67 $this->headers[ $header ] = $value; 68 68 } … … 71 71 * @param array $headers 72 72 */ 73 function set_headers( $headers ) {73 public function set_headers( $headers ) { 74 74 foreach ( $headers as $header => $value ) { 75 75 $this->set_header( $header, $value ); … … 80 80 * @param string $header 81 81 */ 82 function get_header( $header ) {82 public function get_header( $header ) { 83 83 return isset( $this->headers[ $header ] ) ? $this->headers[ $header ] : false; 84 84 } … … 87 87 * @param Translation_Entry $entry 88 88 */ 89 function translate_entry( &$entry ) {89 public function translate_entry( &$entry ) { 90 90 $key = $entry->key(); 91 91 return isset( $this->entries[ $key ] ) ? $this->entries[ $key ] : false; … … 97 97 * @return string 98 98 */ 99 function translate( $singular, $context = null ) {99 public function translate( $singular, $context = null ) { 100 100 $entry = new Translation_Entry( 101 101 array( … … 119 119 * @param int $count number of items 120 120 */ 121 function select_plural_form( $count ) {121 public function select_plural_form( $count ) { 122 122 return 1 == $count ? 0 : 1; 123 123 } … … 126 126 * @return int 127 127 */ 128 function get_plural_forms_count() {128 public function get_plural_forms_count() { 129 129 return 2; 130 130 } … … 136 136 * @param string $context 137 137 */ 138 function translate_plural( $singular, $plural, $count, $context = null ) {138 public function translate_plural( $singular, $plural, $count, $context = null ) { 139 139 $entry = new Translation_Entry( 140 140 array( … … 162 162 * @return void 163 163 */ 164 function merge_with( &$other ) {164 public function merge_with( &$other ) { 165 165 foreach ( $other->entries as $entry ) { 166 166 $this->entries[ $entry->key() ] = $entry; … … 171 171 * @param object $other 172 172 */ 173 function merge_originals_with( &$other ) {173 public function merge_originals_with( &$other ) { 174 174 foreach ( $other->entries as $entry ) { 175 175 if ( ! isset( $this->entries[ $entry->key() ] ) ) { … … 191 191 * @param int $count 192 192 */ 193 function gettext_select_plural_form( $count ) {193 public function gettext_select_plural_form( $count ) { 194 194 if ( ! isset( $this->_gettext_select_plural_form ) || is_null( $this->_gettext_select_plural_form ) ) { 195 195 list( $nplurals, $expression ) = $this->nplurals_and_expression_from_header( $this->get_header( 'Plural-Forms' ) ); … … 204 204 * @return array 205 205 */ 206 function nplurals_and_expression_from_header( $header ) {206 public function nplurals_and_expression_from_header( $header ) { 207 207 if ( preg_match( '/^\s*nplurals\s*=\s*(\d+)\s*;\s+plural\s*=\s*(.+)$/', $header, $matches ) ) { 208 208 $nplurals = (int) $matches[1]; … … 221 221 * @param string $expression 222 222 */ 223 function make_plural_form_function( $nplurals, $expression ) {223 public function make_plural_form_function( $nplurals, $expression ) { 224 224 try { 225 225 $handler = new Plural_Forms( rtrim( $expression, ';' ) ); … … 238 238 * @return string the expression with parentheses added 239 239 */ 240 function parenthesize_plural_exression( $expression ) {240 public function parenthesize_plural_exression( $expression ) { 241 241 $expression .= ';'; 242 242 $res = ''; … … 267 267 * @return array 268 268 */ 269 function make_headers( $translation ) {269 public function make_headers( $translation ) { 270 270 $headers = array(); 271 271 // Sometimes \n's are used instead of real new lines. … … 286 286 * @param string $value 287 287 */ 288 function set_header( $header, $value ) {288 public function set_header( $header, $value ) { 289 289 parent::set_header( $header, $value ); 290 290 if ( 'Plural-Forms' === $header ) { … … 305 305 public $headers = array(); 306 306 307 function add_entry( $entry ) {307 public function add_entry( $entry ) { 308 308 return true; 309 309 } … … 313 313 * @param string $value 314 314 */ 315 function set_header( $header, $value ) {315 public function set_header( $header, $value ) { 316 316 } 317 317 … … 319 319 * @param array $headers 320 320 */ 321 function set_headers( $headers ) {321 public function set_headers( $headers ) { 322 322 } 323 323 … … 326 326 * @return false 327 327 */ 328 function get_header( $header ) {328 public function get_header( $header ) { 329 329 return false; 330 330 } … … 334 334 * @return false 335 335 */ 336 function translate_entry( &$entry ) {336 public function translate_entry( &$entry ) { 337 337 return false; 338 338 } … … 342 342 * @param string $context 343 343 */ 344 function translate( $singular, $context = null ) {344 public function translate( $singular, $context = null ) { 345 345 return $singular; 346 346 } … … 350 350 * @return bool 351 351 */ 352 function select_plural_form( $count ) {352 public function select_plural_form( $count ) { 353 353 return 1 == $count ? 0 : 1; 354 354 } … … 357 357 * @return int 358 358 */ 359 function get_plural_forms_count() {359 public function get_plural_forms_count() { 360 360 return 2; 361 361 } … … 367 367 * @param string $context 368 368 */ 369 function translate_plural( $singular, $plural, $count, $context = null ) {369 public function translate_plural( $singular, $plural, $count, $context = null ) { 370 370 return 1 == $count ? $singular : $plural; 371 371 } … … 374 374 * @param object $other 375 375 */ 376 function merge_with( &$other ) {376 public function merge_with( &$other ) { 377 377 } 378 378 } -
trunk/src/wp-includes/wp-db.php
r51851 r51919 1217 1217 * @return string 1218 1218 */ 1219 function _weak_escape( $string ) {1219 public function _weak_escape( $string ) { 1220 1220 if ( func_num_args() === 1 && function_exists( '_deprecated_function' ) ) { 1221 1221 _deprecated_function( __METHOD__, '3.6.0', 'wpdb::prepare() or esc_sql()' ); … … 1235 1235 * @return string Escaped string. 1236 1236 */ 1237 function _real_escape( $string ) {1237 public function _real_escape( $string ) { 1238 1238 if ( ! is_scalar( $string ) ) { 1239 1239 return ''; … … 2332 2332 * @return int|false The number of rows affected, or false on error. 2333 2333 */ 2334 function _insert_replace_helper( $table, $data, $format = null, $type = 'INSERT' ) {2334 public function _insert_replace_helper( $table, $data, $format = null, $type = 'INSERT' ) { 2335 2335 $this->insert_id = 0; 2336 2336
Note: See TracChangeset
for help on using the changeset viewer.