0

added to woocommerce product edit page specific tab a multi select box to choose user or users

I got Notice

Undefined variable: args in wp-content/plugins/myplugin/myplugin.php:576

line 576 is

$users = get_users($args);

all code is

/*
 * Tab content
 */
add_action( 'woocommerce_product_data_panels', 'misha_product_panels' );
function misha_product_panels(){
    /*Get user list*/
    $user_list=array();
    $users = get_users($args);
    if( empty($users) )
      return;

    foreach( $users as $user ){
        $user_list[$user->data->ID] = $user->data->display_name;
    }

so please need to fix this notice best regards

  • 1
    You don't have a variable called `$args` defined anywhere here. – Greg Schmidt Apr 20 '20 at 17:29
  • I am not programmer so what is your recommendation f – aymanibrahim Apr 20 '20 at 17:47
  • If you're not a programmer, then presumably you got this code from somewhere else. You could share that source, so that we can understand what it's supposed to do and how your code differs. Alternately, you could always hire a programmer. Or just hope that someone that knows WordPress well see this and understands immediately what the issue is. – Greg Schmidt Apr 20 '20 at 21:00

0 Answers0