Changeset 1375873
- Timestamp:
- 03/21/2016 08:23:22 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
simple-background-video/trunk/simple_background_video_zd.php
r1375829 r1375873 265 265 266 266 267 //nonce field for security 268 wp_nonce_field( 'meta-box-save', 'BVZD-plugin' ); 267 269 268 270 269 ?> … … 466 465 function metabox_artist_url_video_save ( $post_id ) { 467 466 468 469 467 //if autosave skip saving data 470 468 if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) 471 469 return; 472 473 //check nonce for security474 check_admin_referer( 'meta-box-save', 'BVZD-plugin' );475 470 476 471 … … 483 478 update_post_meta( $post_id, '_video-web', sanitize_text_field( $e_video_web ) ); 484 479 } 485 update_post_meta( $post_id, '_video-mp4', esc_url_raw( $_POST['video-mp4'] ) ); 480 if ( !empty($_POST['video-mp4']) ) { 481 update_post_meta( $post_id, '_video-mp4', sanitize_text_field( $_POST['video-mp4'] ) ); 482 } 486 483 487 484 if ( !empty($_POST['title_ZD_select']) ) { … … 494 491 update_post_meta( $post_id, '_color_title_ZD', sanitize_text_field( $_POST['color_title'] ) ); 495 492 } 496 if ( $_POST['video-yvn'] == "no-video") {493 if ( !empty($_POST['video-yvn']) && $_POST['video-yvn'] == "no-video") { 497 494 delete_post_meta( $post_id, '_video-web' ); 498 495 delete_post_meta( $post_id, '_video-mp4' ); 499 496 } 500 if ( $_POST['title_ZD_select'] == "no") {497 if ( !empty($_POST['title_ZD_select']) && $_POST['title_ZD_select'] == "no") { 501 498 delete_post_meta( $post_id, '_custom_title_input' ); 502 499 delete_post_meta( $post_id, '_color_title_ZD' ); … … 504 501 } 505 502 503 504 506 505 add_action('save_post', 'metabox_artist_url_video_save'); 507 506
Note: See TracChangeset
for help on using the changeset viewer.