/home/suroeste/public_html/wp-content/plugins/woocommerce/src/Admin/Features
Edit: /home/suroeste/public_html/wp-content/plugins/woocommerce/src/Admin/Features/TransientNotices.php (2856B)
(string) Unique ID for the notice. Required.
* 'user_id' => (int|null) User ID to show the notice to.
* 'status' => (string) info|error|success
* 'content' => (string) Content to be shown for the notice. Required.
* 'options' => (array) Array of options to be passed to the notice component.
* See https://developer.wordpress.org/block-editor/reference-guides/data/data-core-notices/#createNotice for available options.
* ).
*/
public static function add( $notice ) {
$queue = self::get_queue();
$defaults = array(
'user_id' => null,
'status' => 'info',
'options' => array(),
);
$notice_data = array_merge( $defaults, $notice );
$notice_data['options'] = (object) $notice_data['options'];
$queue[ $notice['id'] ] = $notice_data;
update_option( self::QUEUE_OPTION, $queue );
}
/**
* Remove a notice by ID.
*
* @param array $notice_id Notice of ID to remove.
*/
public static function remove( $notice_id ) {
$queue = self::get_queue();
unset( $queue[ $notice_id ] );
update_option( self::QUEUE_OPTION, $queue );
}
/**
* Preload options to prime state of the application.
*
* @param array $options Array of options to preload.
* @return array
*/
public function preload_options( $options ) {
$options[] = self::QUEUE_OPTION;
return $options;
}
}