Skip to main content
added 134 characters in body
Source Link
blank473
  • 29
  • 1
  • 6

For some reason, the most basic wordpress user query i got from this generator

https://generatewp.com/wp_user_query/

is displaying that it has not found any users

    $args = array (
    );

    // The User Query
    $user_query = new WP_User_Query( $args );

    // The User Loop
    if ( ! empty( $user_query->results ) ) {
        foreach ( $user_query->results as $user ) { 
        //do stuff here
       }
   
   } else { 
   echo "no users found";
   //this is the error i keep getting. so this basic script is not finding any results
  }

am i missing something?

For some reason, the most basic wordpress user query i got from this generator

https://generatewp.com/wp_user_query/

is displaying that it has not found any users

    $args = array (
    );

    // The User Query
    $user_query = new WP_User_Query( $args );

    // The User Loop
    if ( ! empty( $user_query->results ) ) {
        foreach ( $user_query->results as $user ) { }
   
   } else { 
   echo "no users found";
  }

am i missing something?

For some reason, the most basic wordpress user query i got from this generator

https://generatewp.com/wp_user_query/

is displaying that it has not found any users

    $args = array (
    );

    // The User Query
    $user_query = new WP_User_Query( $args );

    // The User Loop
    if ( ! empty( $user_query->results ) ) {
        foreach ( $user_query->results as $user ) { 
        //do stuff here
       }
   
   } else { 
   echo "no users found";
   //this is the error i keep getting. so this basic script is not finding any results
  }

am i missing something?

Source Link
blank473
  • 29
  • 1
  • 6

Basic Wp_user_query not finding any users

For some reason, the most basic wordpress user query i got from this generator

https://generatewp.com/wp_user_query/

is displaying that it has not found any users

    $args = array (
    );

    // The User Query
    $user_query = new WP_User_Query( $args );

    // The User Loop
    if ( ! empty( $user_query->results ) ) {
        foreach ( $user_query->results as $user ) { }
   
   } else { 
   echo "no users found";
  }

am i missing something?