';
if ( ! VV_Helpers::is_vendor() ) return '';
return null;
}
// ── Add Product ──────────────────────────────────────────────────────────
public static function render_add( $atts = [] ) {
if ( $err = self::guard() ) return $err;
$uid = get_current_user_id();
$max = VV_Subscription::max_products( $uid );
$current = count( get_posts( [ 'post_type' => 'product', 'post_status' => [ 'publish','pending','draft' ], 'post_author' => $uid, 'fields' => 'ids' ] ) );
ob_start();
?>
'product',
'post_status' => [ 'publish', 'pending', 'draft' ],
'post_author' => $uid,
'numberposts' => 100,
'orderby' => 'date',
'order' => 'DESC',
] );
global $wpdb;
ob_start();
?>
No product specified.
';
if ( (int) get_post_field( 'post_author', $pid ) !== $uid ) return '';
$product = wc_get_product( $pid );
if ( ! $product ) return '';
ob_start();
?>
get_id() : 0;
$categories = get_terms( [ 'taxonomy' => 'product_cat', 'hide_empty' => false ] );
$tags_val = $pid ? implode( ', ', wp_get_post_tags( $pid, [ 'fields' => 'names' ] ) ) : '';
$cat_terms = $pid ? wp_get_post_terms( $pid, 'product_cat', [ 'fields' => 'slugs' ] ) : [];
$p_type = $pid && $product->is_downloadable() ? 'downloadable' : 'virtual';
?>