Skip to content

Commit

Permalink
Reorder post ID zeroing for restricted posts.
Browse files Browse the repository at this point in the history
This was previous done *first*, which prevented `get_permalink` from
doing its thing.
  • Loading branch information
Michael Sisk committed Aug 21, 2012
1 parent efb1276 commit 1edcac2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions webcomic.php
Expand Up @@ -575,15 +575,14 @@ public function the_post( $post ) {

if ( isset( self::$config[ 'collections' ][ $post->post_type ] ) ) {
if ( !WebcomicTag::verify_webcomic_role( $post->post_type ) ) {
$post->ID = 0;
$post->post_title = __( 'Restricted Content', 'webcomic' );
$pages = array( is_user_logged_in() ? __( "You don't have permission to view this content.", 'webcomic' ) : sprintf( __( 'You must <a href="%s">log in</a> to view this content.', 'webcomic' ), wp_login_url( get_permalink( $post->ID ) ) ) );
$post->content = $pages[ 0 ];
} else if ( !$clear = WebcomicTag::verify_webcomic_age( $post->post_type ) ) {
$post->ID = 0;
$post->post_title = __( 'Restricted Content', 'webcomic' );
$pages = array( is_null( $clear ) ? sprintf( __( 'Please <a href="%s">verify your age</a> to view this content.', 'webcomic' ), get_permalink( $post->ID ) ) : __( "You don't have permission to view this content.", 'webcomic' ) );
$post->content = $pages[ 0 ];
$post->ID = 0;
}
}
}
Expand Down

0 comments on commit 1edcac2

Please sign in to comment.