Automatic_Upgrader_Skin::feedback
Stores a message about the upgrade.
Метод класса: Automatic_Upgrader_Skin{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$Automatic_Upgrader_Skin = new Automatic_Upgrader_Skin(); $Automatic_Upgrader_Skin->feedback( $feedback, ...$args );
- $feedback(строка|массив|WP_Error) (обязательный)
- Message data.
- ...$args(разное) (обязательный)
- Optional text replacements.
Список изменений
С версии 3.7.0 | Введена. |
С версии 5.9.0 | Renamed $data to $feedback for PHP 8 named parameter support. |
Код Automatic_Upgrader_Skin::feedback() Automatic Upgrader Skin::feedback WP 6.8.1
public function feedback( $feedback, ...$args ) { if ( is_wp_error( $feedback ) ) { $string = $feedback->get_error_message(); } elseif ( is_array( $feedback ) ) { return; } else { $string = $feedback; } if ( ! empty( $this->upgrader->strings[ $string ] ) ) { $string = $this->upgrader->strings[ $string ]; } if ( str_contains( $string, '%' ) ) { if ( ! empty( $args ) ) { $string = vsprintf( $string, $args ); } } $string = trim( $string ); // Only allow basic HTML in the messages, as it'll be used in emails/logs rather than direct browser output. $string = wp_kses( $string, array( 'a' => array( 'href' => true, ), 'br' => true, 'em' => true, 'strong' => true, ) ); if ( empty( $string ) ) { return; } $this->messages[] = $string; }