Changeset 8220 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-admin.php
- Timestamp:
- 02/11/2019 03:43:41 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wcpt/wcpt-event/class-event-admin.php
r8135 r8220 403 403 404 404 /** 405 * Save metadata from form 405 * Save metadata from form. 406 * 407 * @param int $post_id The ID of the post being saved. 408 * @param WP_Post $post The post being saved. 409 * @param bool $verify_nonce Whether or not to verify the nonce. Set to false when calling manually, leave 410 * true when calling via `save_post` hook. 406 411 * 407 412 * @hook save_post 408 413 */ 409 public function metabox_save( $post_id, $post ) {414 public function metabox_save( $post_id, $post, $verify_nonce = true ) { 410 415 // Don't add/remove meta on revisions and auto-saves. 411 416 if ( wp_is_post_autosave( $post_id ) || wp_is_post_revision( $post_id ) ) { … … 418 423 419 424 // Make sure the request came from the edit post screen. 420 if ( empty( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], 'update-post_' . $post_id ) ) { 421 die( 'Unable to verify nonce' ); 425 if ( $verify_nonce ) { 426 if ( empty( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], 'update-post_' . $post_id ) ) { 427 wp_die( 'Unable to verify nonce.' ); 428 } 422 429 } 423 430
Note: See TracChangeset
for help on using the changeset viewer.