From 1edcac2c09c747c0a5308f611dd70b522a85a28c Mon Sep 17 00:00:00 2001 From: Michael Sisk Date: Tue, 21 Aug 2012 08:56:39 -0400 Subject: [PATCH] Reorder post ID zeroing for restricted posts. This was previous done *first*, which prevented `get_permalink` from doing its thing. --- webcomic.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/webcomic.php b/webcomic.php index 1a56e66..e734da2 100755 --- a/webcomic.php +++ b/webcomic.php @@ -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 log in 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 verify your age 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; } } }