Automattic\WooCommerce\Admin\Notes
Note::set_layout
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.
Note::set_layout() Note::set layout code WC 10.5.0
public function set_layout( $layout ) {
// If we don't receive a layout we will set it by default as "plain".
if ( empty( $layout ) ) {
$layout = 'plain';
}
$valid_layouts = array( 'plain', 'thumbnail' );
if ( in_array( $layout, $valid_layouts, true ) ) {
$this->set_prop( 'layout', $layout );
} else {
$this->error( 'admin_note_invalid_data', __( 'The admin note layout has a wrong prop value.', 'woocommerce' ) );
}
}