You appear to be a bot. Output may be restricted
Description
Handles dismissing of Jetpack Notices
Usage
$array|wp-error = Jetpack_Core_Json_Api_Endpoints::dismiss_notice( $request );
Parameters
- $request
- ( WP_REST_Request ) required – The request sent to the WP REST API.
Returns
array|wp-error
Source
File name: jetpack/_inc/lib/class.core-rest-api-endpoints.php
Lines:
1 to 23 of 23
public static function dismiss_notice( $request ) { $notice = $request['notice']; if ( ! isset( $request['dismissed'] ) || $request['dismissed'] !== true ) { return new WP_Error( 'invalid_param', esc_html__( 'Invalid parameter "dismissed".', 'jetpack' ), array( 'status' => 404 ) ); } if ( isset( $notice ) && ! empty( $notice ) ) { switch( $notice ) { case 'feedback_dash_request': case 'welcome': $notices = get_option( 'jetpack_dismissed_notices', array() ); $notices[ $notice ] = true; update_option( 'jetpack_dismissed_notices', $notices ); return rest_ensure_response( get_option( 'jetpack_dismissed_notices', array() ) ); default: return new WP_Error( 'invalid_param', esc_html__( 'Invalid parameter "notice".', 'jetpack' ), array( 'status' => 404 ) ); } } return new WP_Error( 'required_param', esc_html__( 'Missing parameter "notice".', 'jetpack' ), array( 'status' => 404 ) ); }