Automattic\WooCommerce\Admin\Notes
Note::set_type()
Set note type.
Метод класса: Note{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$Note = new Note(); $Note->set_type( $type );
- $type(строка) (обязательный)
- Note type.
Код Note::set_type() Note::set type WC 9.7.1
public function set_type( $type ) { if ( empty( $type ) ) { $this->error( 'admin_note_invalid_data', __( 'The admin note type prop cannot be empty.', 'woocommerce' ) ); } if ( ! in_array( $type, self::get_allowed_types(), true ) ) { $this->error( 'admin_note_invalid_data', sprintf( /* translators: %s: admin note type. */ __( 'The admin note type prop (%s) is not one of the supported types.', 'woocommerce' ), $type ) ); } $this->set_prop( 'type', $type ); }