Index of /andrejciho/Wordpress MU/Site Admin's Ability to See Protected Post

Name Last modified Comments Description

Back Parent Directory

Site Admin's Ability to See Protected Post

In some setting, such as when a university hosts student blogs / portfolios, it is essential that a site administrator has the ability to see all the posts and pages, even the ones that users set as password-protected. This can be accomplished by modifying a single line of code.

In the file ./wp-includes/post-template.php you'll have to modify the function get_the_content() so that instead of:

if ( !empty($post->post_password) ) {

it will say

if ( !empty($post->post_password) AND !is_site_admin()) {


Leave a Comment
*Required
*Required (Never published)
 

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image