2014-03-30 93 views
1

在我將WP更新到最新版本後,發生了這種情況。 URL是:http://www.movie-galaxy.com注意:未定義索引:操作

說明:未定義指數:video_width在/home1/djandrei/public_html/movie-galaxy.com/wp-content/themes/DarkTheme/functions.php上線507

說明:未定義指數:video_height在/home1/djandrei/public_html/movie-galaxy.com/wp-content/themes/DarkTheme/functions.php上線508

警告:不能更改頭信息 - 已經(輸出發送開始頭在/home1/djandrei/public_html/movie-galaxy.com/wp-admin/post.php上的/home1/djandrei/public_html/movie-galaxy.com/wp-content/themes/DarkTheme/functions.php:507)第2行

add_action('publish_post', 'ys_video_add_post_meta'); 
function ys_video_add_post_meta($post_ID) { 
    global $wpdb; 
    update_post_meta($post_ID, '_video_portal', $_POST["video_portal"]); 
    update_post_meta($post_ID, '_video_id', $_POST["video_id"]); 
    update_post_meta($post_ID, '_video_width', $_POST["video_width"]); 
    update_post_meta($post_ID, '_video_height', $_POST["video_height"]); 
    update_post_meta($post_ID, '_video_thumbnail', $_POST["video_thumbnail"]); 
    update_post_meta($post_ID, '_video_thumbnail_small', $_POST["video_thumbnail_small"]); 
    update_post_meta($post_ID, '_movie_featured', $_POST["movie_featured"]); 
    update_post_meta($post_ID, '_video_dvd_downurl', $_POST["video_dvd_downurl"]); 

    update_post_meta($post_ID, '_featured_prcture', $_POST["featured_prcture"]); 
    update_post_meta($post_ID, '_featured_prcture_small', $_POST["featured_prcture_small"]); 

    update_post_meta($post_ID, '_flv_url', $_POST["flv_url"]); 
} 

回答

1

檢查您的POST數據是否設置。

if(isset($_POST["action"]) && $_POST["action"] == "video_thumbnail_upload_submit") { 
+0

這工作,但現在我得到另一個錯誤:(說明:未定義指數:video_width在/home1/djandrei/public_html/movie-galaxy.com/wp-content/themes/DarkTheme/functions.php上line 507 update_post_meta($ post_ID,'_video_height',$ _POST [「video_height」]) – user1649351

+0

我們需要查看更多的代碼來檢查錯誤,但我的猜測是嘗試同樣的事情,將它包裹在一個'isset ()' – Stewartside

+0

編輯第二個問題的主要帖子 – user1649351