Get list of users in looper provider

Is there any way to get a list of users, so I can show the acf content attached to specific users?

Hello @jrhager84

Thanks for writing to us,

It is not possible to list the user from the default Looper, you need to create the custom looper for it. Please have a look at our doc to learn more about how to create custom looper.

You may try this custom code for custom Looper to pull the user list. The given code would list the user whose role is “Author” and “Subscriber”.

add_filter( 'cs_looper_custom_my_data', function( $result ) {
  $blogusers = get_users( array( 'role__in' => array( 'author', 'subscriber' ) ) );
  return $blogusers;
});

Please note that the code provided in the above is a guide only and is to help you in getting started so implementing it and maintaining the code will be out of our support scope and for further maintenance for new possible versions of the theme that may cause the customization to break, you will need to hire a developer or subscribe to One where customization question is answered.

Thanks

So does the hook not include the prepended tags? So in this case, cs_looper_custom_my_data would just be custom_my_data or my_data?

Hello @jrhager84,

You will have to use my_data in your Looper Provider.

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.