Changeset 46125
- Timestamp:
- 09/15/2019 10:41:03 AM (5 years ago)
- Location:
- trunk/src/wp-admin/includes
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/class-automatic-upgrader-skin.php
r43571 r46125 59 59 /** 60 60 * @param string|array|WP_Error $data 61 * @param mixed ...$args Optional text replacements. 61 62 */ 62 public function feedback( $data ) {63 public function feedback( $data, ...$args ) { 63 64 if ( is_wp_error( $data ) ) { 64 65 $string = $data->get_error_message(); … … 73 74 74 75 if ( strpos( $string, '%' ) !== false ) { 75 $args = func_get_args();76 $args = array_splice( $args, 1 );77 76 if ( ! empty( $args ) ) { 78 77 $string = vsprintf( $string, $args ); -
trunk/src/wp-admin/includes/class-bulk-upgrader-skin.php
r45932 r46125 51 51 /** 52 52 * @param string $string 53 * @param mixed ...$args Optional text replacements. 53 54 */ 54 public function feedback( $string ) {55 public function feedback( $string, ...$args ) { 55 56 if ( isset( $this->upgrader->strings[ $string ] ) ) { 56 57 $string = $this->upgrader->strings[ $string ]; … … 58 59 59 60 if ( strpos( $string, '%' ) !== false ) { 60 $args = func_get_args();61 $args = array_splice( $args, 1 );62 61 if ( $args ) { 63 62 $args = array_map( 'strip_tags', $args ); -
trunk/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php
r45487 r46125 79 79 * @since 4.6.0 80 80 * 81 * @param string|WP_Error $errors Errors. 81 * @param string|WP_Error $errors Errors. 82 * @param mixed ...$args Optional text replacements. 82 83 */ 83 public function error( $errors ) {84 public function error( $errors, ...$args ) { 84 85 if ( is_string( $errors ) ) { 85 86 $string = $errors; … … 89 90 90 91 if ( false !== strpos( $string, '%' ) ) { 91 $args = func_get_args();92 $args = array_splice( $args, 1 );93 92 if ( ! empty( $args ) ) { 94 93 $string = vsprintf( $string, $args ); … … 105 104 } 106 105 107 $args = func_get_args(); 108 call_user_func_array( array( $this, 'parent::error' ), $args ); 106 parent::error( $errors, ...$args ); 109 107 } 110 108 … … 114 112 * @since 4.6.0 115 113 * 116 * @param string|array|WP_Error $data Log entry data. 114 * @param string|array|WP_Error $data Log entry data. 115 * @param mixed ...$args Optional text replacements. 117 116 */ 118 public function feedback( $data ) {117 public function feedback( $data, ...$args ) { 119 118 if ( is_wp_error( $data ) ) { 120 119 foreach ( $data->get_error_codes() as $error_code ) { … … 123 122 } 124 123 125 $args = func_get_args(); 126 call_user_func_array( array( $this, 'parent::feedback' ), $args ); 124 parent::feedback( $data, ...$args ); 127 125 } 128 126 } -
trunk/src/wp-admin/includes/class-wp-upgrader-skin.php
r44964 r46125 141 141 /** 142 142 * @param string $string 143 */ 144 public function feedback( $string ) { 143 * @param mixed ...$args Optional text replacements. 144 */ 145 public function feedback( $string, ...$args ) { 145 146 if ( isset( $this->upgrader->strings[ $string ] ) ) { 146 147 $string = $this->upgrader->strings[ $string ]; … … 148 149 149 150 if ( strpos( $string, '%' ) !== false ) { 150 $args = func_get_args();151 $args = array_splice( $args, 1 );152 151 if ( $args ) { 153 152 $args = array_map( 'strip_tags', $args );
Note: See TracChangeset
for help on using the changeset viewer.