Automattic\WooCommerce\Admin\Notes
Note::set_layout
Устарела с версии 10.8.0 Inbox notes no longer support layout variants; only 'plain' is valid and the field will be removed in a future release.. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.
Set note layout.
Метод класса: Note{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$Note = new Note(); $Note->set_layout( $layout );
- $layout(строка) (обязательный)
- Note layout.
Список изменений
| Устарела с 10.8.0 | Inbox notes no longer support layout variants; only 'plain' is valid and the field will be removed in a future release. |
Код Note::set_layout() Note::set layout WC 11.1.0
public function set_layout( $layout ) {
wc_deprecated_function( __METHOD__, '10.8.0' );
// 'thumbnail' was previously a valid value but is no longer rendered. Coerce it to 'plain'
// so existing callers don't break, and surface a deprecation warning so they update.
if ( 'thumbnail' === $layout ) {
wc_deprecated_argument( __METHOD__, '10.8.0', "The 'thumbnail' layout is no longer supported; coerced to 'plain'." );
$layout = 'plain';
}
if ( empty( $layout ) ) {
$layout = 'plain';
}
if ( 'plain' === $layout ) {
$this->set_prop( 'layout', $layout );
} else {
$this->error( 'admin_note_invalid_data', __( 'The admin note layout has a wrong prop value.', 'woocommerce' ) );
}
}