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"]);
}
这工作,但现在我得到另一个错误:(说明:未定义指数: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
我们需要查看更多的代码来检查错误,但我的猜测是尝试同样的事情,将它包裹在一个'isset ()' – Stewartside
编辑第二个问题的主要帖子 – user1649351