Automattic\WooCommerce\Admin\Notes
Note::set_layout
Deprecated since 10.8.0 Inbox notes no longer support layout variants; only 'plain' is valid and the field will be removed in a future release.. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
Set note layout.
Method of the class: Note{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Note = new Note(); $Note->set_layout( $layout );
- $layout(string) (required)
- Note layout.
Changelog
| Deprecated since 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 code WC 11.0.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' ) );
}
}