五十路熟女俱乐部,荫蒂添的好舒服视频,在线亚洲97se亚洲综合在线,伊人久久大香线蕉亚洲五月天,,国语精品自产拍在线观看网站

Bug反饋:5.7.1版本里的首頁(yè)資訊篩選有問(wèn)題

墨寞 發(fā)布于 分類(lèi):分享

如題,5.7.1版本里的function wpcom_load_posts() 函數(shù)有問(wèn)題,導(dǎo)致首頁(yè)的最新資訊里仍然顯示已經(jīng)設(shè)置為不顯示的分類(lèi)。跟5.4.0版本的代碼對(duì)比了一下,發(fā)現(xiàn)5.7.1的代碼做了一點(diǎn)修改,導(dǎo)致這種問(wèn)題的發(fā)生。改為5.4.0版本的代碼即可正常。

問(wèn)題代碼如下:

5.7.1版本

$exclude = isset($_POST['exclude']) ? $_POST['exclude'] : '';
if($exclude) $exclude = explode(',', $exclude);
$exclude = $exclude ? $exclude : array();
$arg = array(
'posts_per_page' => $per_page,
'paged' => $page,
'ignore_sticky_posts' => 0,
'post_type' => 'post',
'post_status' => array( 'publish' ),
'category__not_in' => $exclude
);
$posts = new WP_Query($arg);

5.4.0版本

global $options;
$exclude = isset($_POST['exclude']) ? $_POST['exclude'] : '';
if($exclude) $exclude = explode(',', $exclude);
$exclude = $exclude ? $exclude : $options['newest_exclude'];
$arg = array(
'posts_per_page' => $per_page,
'paged' => $page,
'ignore_sticky_posts' => 0,
'post_type' => 'post',
'post_status' => array( 'publish' ),
'category__not_in' => $exclude ? $exclude : array()
);
$posts = new WP_Query($arg);

折騰老半天才找出來(lái),排除了插件兼容性等因素之后,最終意識(shí)到應(yīng)該是代碼的問(wèn)題,多虧還保留了一份以前的版本:(:(:(:(

3個(gè)回復(fù)

微信咨詢(xún)
QQ咨詢(xún)
掃碼關(guān)注

掃碼關(guān)注微信

關(guān)注我們獲取最新資訊 關(guān)注微信公眾號(hào) 立即掃碼關(guān)注我們