As the title says, I’d like to restrict back-end access to certain pages for certain users.
While doing a site with 45-50 pages, I realised it would be a much better user experience if the Page menu only listed those pages which the user should be able to change/update.
I’ve tried the plugins below to no avail. Advanced access manager has the functionality but does not work/is buggy on 3.5.1.
http://wordpress.org/extend/plugins/advanced-access-manager
http://wordpress.org/extend/plugins/role-scoper
http://wordpress.org/extend/plugins/adminimize
http://wordpress.org/extend/plugins/s2member
Code snippet in functions.php?
This code seems to work well for me (in functions.php):
It won’t let me comment, so I’m adding this as a new answer.
The error:
… is due to the function being called only after the user_id is checked. So if you’re logged in NOT as that user, the function doesn’t exist, and the filter returns that error, since it is looking for the function, but can’t find it.
So it should be: