0
如何强制用户在创建新产品时继续编辑之前先选择类别产品?创建新产品之前Woocommerce Force类别的选择?
我发现了一个成功的解决方案,但它是针对帖子而不是产品。 https://wordpress.stackexchange.com/questions/14403/force-category-choice-before-creating-new-post
如何强制用户在创建新产品时继续编辑之前先选择类别产品?创建新产品之前Woocommerce Force类别的选择?
我发现了一个成功的解决方案,但它是针对帖子而不是产品。 https://wordpress.stackexchange.com/questions/14403/force-category-choice-before-creating-new-post
看来你是指代码会为你工作,如果你改变了下面的代码:
$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;
}
希望这会为你工作。
我试了一下,当我点击“添加产品”时,我得到页面强制我选择一个类别,但是它列出了帖子类别而不是产品类别。 – hazemhazem