Changeset 13335 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-self-toggle-preview.php
- Timestamp:
- 03/14/2024 05:40:44 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/api/routes/class-plugin-self-toggle-preview.php
r13037 r13335 64 64 header( 'Location: ' . $result['location'] ); 65 65 66 if ( $request->get_param('dismiss') ) { 67 return $this->self_dismiss( $request, $plugin ); 68 } 69 66 70 // Toggle the postmeta value. Note that there is a race condition here. 67 71 $did = ''; … … 83 87 } 84 88 89 /** 90 * Endpoint special case to dismiss the missing blueprint notice. 91 * 92 * @param \WP_REST_Request $request The Rest API Request. 93 * @param object $plugin The plugin post. 94 * @return bool True if the toggle was successful. 95 */ 96 public function self_dismiss( $request, $plugin ) { 97 $result = [ 98 'location' => wp_get_referer() ?: get_permalink( $plugin ), 99 ]; 100 101 // Change the value from 1 to 0. This will persist and prevent it from being added again. 102 update_post_meta( $plugin->ID, '_missing_blueprint_notice', 0, 1 ); 103 104 return $result; 105 } 85 106 }
Note: See TracChangeset
for help on using the changeset viewer.