2017-02-10 75 views

回答

1

看来你是指代码会为你工作,如果你改变了下面的代码:

$post_type = 'post'; 
    if (isset($_REQUEST['post_type'])) { 
     $post_type = $_REQUEST['post_type']; 
    } 

    // Only do this for posts 
    if ('post' != $post_type) { 
     return; 
    } 

$post_type = 'product'; 
if (isset($_REQUEST['post_type'])) { 
    $post_type = $_REQUEST['post_type']; 
} 

// Only do this for posts 
if ('product' != $post_type) { 
    return; 
} 

希望这会为你工作。

+0

我试了一下,当我点击“添加产品”时,我得到页面强制我选择一个类别,但是它列出了帖子类别而不是产品类别。 – hazemhazem

相关问题