Hello Carlos, I think the first problem its in the next code lines of class-vendors.php
(file: wc-vendor/classes/class-vendors.php)
(Line aprox. 290)
/**
* Checks whether the ID provided is vendor capable or not
*
* @param int $user_id
*
* @return bool
*/
public static function is_vendor( $user_id )
{
$user = get_userdata( $user_id );
if (is_object($user)) {
$is_vendor = is_array( $user->roles ) ? in_array( 'vendor', $user->roles ) : false;
} else {
$is_vendor = false;
}
return apply_filters( 'pv_is_vendor', $is_vendor, $user_id );
}
OR in that:
(file: wc-vendor/classes/admin/class-admin-users.php)
function __construct()
{
if ( !is_admin() ) return;
add_action( 'edit_user_profile', array( $this, 'show_extra_profile_fields' ) );
add_action( 'edit_user_profile_update', array( $this, 'save_extra_profile_fields' ) );
add_filter( 'add_menu_classes', array( $this, 'show_pending_number' ) );
// Disabling non-vendor related items on the admin screens
if ( WCV_Vendors::is_vendor( get_current_user_id() ) ) {
add_filter( 'woocommerce_csv_product_role', array( $this, 'csv_import_suite_compatibility' ) );
add_filter( 'woocommerce_csv_product_export_args', array( $this, 'csv_import_suite_compatibility_export' ) );
// Admin page lockdown
remove_action( 'admin_init', 'woocommerce_prevent_admin_access' );
add_action( 'admin_init', array( $this, 'prevent_admin_access' ) );
add_filter( 'woocommerce_prevent_admin_access', array( $this, 'deny_admin_access' ) );
// WC > Product page fixes
add_action( 'load-post-new.php', array( $this, 'confirm_access_to_add' ) );
add_action( 'load-edit.php', array( $this, 'edit_nonvendors' ) );
add_filter( 'views_edit-product', array( $this, 'hide_nonvendor_links' ) );
// Filter user attachments so they only see their own attachements
add_action( 'ajax_query_attachments_args', array( $this, 'show_user_attachment_ajax' ) );
add_filter( 'parse_query', array( $this, 'show_user_attachment_page' ) );
add_action( 'admin_menu', array( $this, 'remove_menu_page' ), 99 );
add_action( 'add_meta_boxes', array( $this, 'remove_meta_boxes' ), 99 );
add_filter( 'product_type_selector', array( $this, 'filter_product_types' ), 99, 2 );
add_filter( 'product_type_options', array( $this, 'filter_product_type_options' ), 99 );
add_filter( 'woocommerce_duplicate_product_capability', array( $this, 'add_duplicate_capability' ) );
// WC > Product featured
$product_misc = (array) WC_Vendors::$pv_options->get_option( 'hide_product_misc' );
if ( isset( $product_misc['featured'] ) ) {
add_filter( 'manage_product_posts_columns', array($this, 'manage_product_columns'), 99);
}
}
}
I know this code is in the wc-vendor, but I put it there because is more helpful, if Julien or other can view something that affect the code of the awesome support.
I will continue searching and making testing.