Created
July 28, 2013 09:13
-
-
Save maor/6098045 to your computer and use it in GitHub Desktop.
Conditionally display content depending on whether the user is logged in or not
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// https://www.facebook.com/groups/wordpress.support/permalink/497037907031944 | |
function mc_497037907031944( $content ) { | |
if ( is_user_logged_in() ) | |
return $content; | |
else | |
return 'Sorry, you must be logged in...'; | |
} | |
add_filter( 'the_content', 'mc_497037907031944' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment