Jump to content

Get pages a user created


kyle
 Share

Recommended Posts

I took a look through the API but couldn't seem to find a way to get the pages created by a user.  I was hoping that there would be some sort of array that tracks the pages that a user created and would be accessible with something like $user->pagesCreated().

If there isn't anything link this in processwire, how difficult would it be to create?

Link to comment
Share on other sites

I think this should do what you are looking for:

$pages->find('created_users_id=n');

where n equals the id of the user you are looking for. If you are searching for the currently logged in user, you could replace this with $user->id

PS, Welcome to PW!

  • Like 4
Link to comment
Share on other sites

@adrian Thanks so much for the help.  This was a preliminary question for my upcoming project, and I will let you know if I have any issues!  Thanks for the welcome, I was lucky enough to find out about Processwire and it has quickly become my go-to CMS.

@renobird Thank you!

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...