Permalink
Browse files

Reorder post ID zeroing for restricted posts.

This was previous done *first*, which prevented `get_permalink` from
doing its thing.
  • Loading branch information...
1 parent efb1276 commit 1edcac2c09c747c0a5308f611dd70b522a85a28c @mgsisk committed Aug 21, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 webcomic.php
View
@@ -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;
}
}
}

0 comments on commit 1edcac2

Please sign in to comment.