Remove RSS feed from hidden stories

This commit is contained in:
Tetrakern 2023-06-13 11:26:34 +02:00
parent b57bb50c59
commit c64384cb40
2 changed files with 4 additions and 3 deletions

View File

@ -31,7 +31,7 @@ $feed = fictioneer_get_rss_link();
<?php $feed_url = urlencode( $feed ); ?>
<?php if ( get_post_type() == 'fcn_story' ) : ?>
<?php if ( get_post_type() == 'fcn_story' && ! fictioneer_get_field( 'fictioneer_story_hidden', get_the_ID() ) ) : ?>
<a
href="<?php echo $feed; ?>"
class="rss-link tooltipped"

View File

@ -14,10 +14,11 @@
*/
// Get ID from parameter
$story_id = fictioneer_validate_id( $_GET[ 'story_id' ], 'fcn_story' );
$story_id = fictioneer_validate_id( $_GET[ 'story_id' ] ?? 0, 'fcn_story' );
$is_hidden = fictioneer_get_field( 'fictioneer_story_hidden', $story_id ?: 0 ) ?: 0;
// Abort if not a valid story ID or password protected
if ( ! $story_id || post_password_required( $story_id ) ) {
if ( ! $story_id || $is_hidden || post_password_required( $story_id ) ) {
wp_redirect( home_url() );
exit();
}