Automattic\WooCommerce\Admin\Notes
Note::set_status
Set note status.
Method of the class: Note{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Note = new Note(); $Note->set_status( $status );
- $status(string) (required)
- Note status.
Note::set_status() Note::set status code WC 10.5.0
public function set_status( $status ) {
if ( empty( $status ) ) {
$this->error( 'admin_note_invalid_data', __( 'The admin note status prop cannot be empty.', 'woocommerce' ) );
}
if ( ! in_array( $status, self::get_allowed_statuses(), true ) ) {
$this->error(
'admin_note_invalid_data',
sprintf(
/* translators: %s: admin note status property. */
__( 'The admin note status prop (%s) is not one of the supported statuses.', 'woocommerce' ),
$status
)
);
}
$this->set_prop( 'status', $status );
}