Advertisement
palsushobhan

hide-stores-with-no-logo-from-storelist

Jul 18th, 2024
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.59 KB | None | 0 0
  1. add_action( 'pre_user_query', function($store_query) {
  2.     global $wpdb;
  3.     if ( empty( $store_query->query_vars['role__in'] ) || $store_query->query_vars['role__in'] !== ['wcfm_vendor'] ) {
  4.         return;
  5.     }
  6.     $store_query->query_from .= " LEFT JOIN $wpdb->usermeta _um ON $wpdb->users.ID = _um.user_id ";
  7.     $store_query->query_where .= $wpdb->prepare(
  8.         " AND _um.meta_key = %s
  9.          AND _um.meta_value LIKE %s
  10.          AND _um.meta_value NOT LIKE %s",
  11.         'wcfmmp_profile_settings',
  12.         '%s:8:"gravatar";%',
  13.         '%s:8:"gravatar";s:0:"";%'
  14.     );
  15. }, 51 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement