add_shortcode('show_my_products','func_show_my_products'); function func_show_my_products(){ $products_val = get_posts( array( 'post_type' => 'product', 'post_status' => 'publish', 'author' => get_current_user_id() ) ); foreach($products_val as $pr){ $product_ids[]=$pr->ID; } $pr_ids=implode(',',$product_ids); if(!empty($pr_ids)) { echo do_shortcode('[products ids='.$pr_ids.']'); } else { echo "No Products"; } }
Ich habe das versucht, aber bekomme nicht nur das Produkt von admin zugewiesen.