Plugin Directory

Changeset 1375873


Ignore:
Timestamp:
03/21/2016 08:23:22 PM (10 years ago)
Author:
willyxd
Message:

Error new page

File:
1 edited

Legend:

Unmodified
Added
Removed
  • simple-background-video/trunk/simple_background_video_zd.php

    r1375829 r1375873  
    265265
    266266
    267     //nonce field for security
    268     wp_nonce_field( 'meta-box-save', 'BVZD-plugin' );
     267   
    269268
    270269    ?>
     
    466465function metabox_artist_url_video_save ( $post_id ) {
    467466
    468 
    469467    //if autosave skip saving data
    470468    if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
    471469        return;
    472 
    473     //check nonce for security
    474     check_admin_referer( 'meta-box-save', 'BVZD-plugin' );
    475470
    476471
     
    483478        update_post_meta( $post_id, '_video-web', sanitize_text_field( $e_video_web ) );
    484479    }
    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    }
    486483   
    487484    if ( !empty($_POST['title_ZD_select']) ) {
     
    494491        update_post_meta( $post_id, '_color_title_ZD', sanitize_text_field( $_POST['color_title'] ) );
    495492    }
    496     if ($_POST['video-yvn'] == "no-video") {
     493    if ( !empty($_POST['video-yvn']) && $_POST['video-yvn'] == "no-video") {
    497494        delete_post_meta( $post_id, '_video-web' );
    498495        delete_post_meta( $post_id, '_video-mp4' );
    499496    }
    500     if ($_POST['title_ZD_select'] == "no") {
     497    if ( !empty($_POST['title_ZD_select']) && $_POST['title_ZD_select'] == "no") {
    501498        delete_post_meta( $post_id, '_custom_title_input' );
    502499        delete_post_meta( $post_id, '_color_title_ZD' );
     
    504501}
    505502
     503
     504
    506505add_action('save_post', 'metabox_artist_url_video_save');
    507506
Note: See TracChangeset for help on using the changeset viewer.