I was able to get this to work! :)
Here is my code. Is this a proper solution or where can I improve this? :)
Thanlks
add_filter( 'manage_edit-product_columns', 'custom_admin_products_store_name_column', 9999 );
function custom_admin_products_store_name_column( $columns ){
$columns['vendor_store_name'] = __( 'Vendor');
return $columns;
}
add_action( 'manage_product_posts_custom_column', 'custom_admin_products_store_name_column_content', 10, 2 );
function custom_admin_products_store_name_column_content( $column, $product_id ){
$seller = get_post_field( 'post_author', $product_id);
$store_info = dokan_get_store_info( $seller );
$store_name = $store_info['store_name'];
$vendor_products = get_admin_url() . 'edit.php?post_type=product&author=' . $seller;
if ( $column == 'vendor_store_name' ) {
printf('<a href="%s">%s</a>', $vendor_products, $store_name);
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…