С помощью CSS мне удалось частично скрыть те элементы, которые мне не нужны. быть видимым:
Код: Выделить всё
.current,
.draft,
.publish,
.search-box,
.byorder,
.tablenav.top,
.page-title-action {
display: none;
visibility:hidden;
}
Код: Выделить всё
function exclude_other_author_products($query) {
$current_user = wp_get_current_user();
if (in_array('administrator', $current_user->shop_manager)
return $query;
if ($query->query['post_type'] == 'product' && $query->is_main_query()) {
$query->set('author__in', $current_user->ID);
}
}
add_action('pre_get_posts', 'exclude_other_author_products');
Какой совет?
Подробнее здесь: https://stackoverflow.com/questions/693 ... product-li