make sure spotlight is published before showing on profile

This commit is contained in:
Evan Mullins 2022-11-15 14:49:47 -05:00
parent 6ead9e9fcf
commit 4a7dd576ea
2 changed files with 2 additions and 2 deletions

View file

@ -5,7 +5,7 @@
Author: Evan Mullins
Author URI: https://circlecube.com
Template: twentynineteen
Version: 1.10.12
Version: 1.10.13
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: wasmo

View file

@ -6,7 +6,7 @@
<?php
$spotlight_id = get_user_meta( $userid, 'spotlight_post', true );
if ( $spotlight_id ) { ?>
if ( $spotlight_id && get_post_status( $spotlight_id ) === 'publish' ) { ?>
<aside class="widget-area" style="margin: 1rem 0 -2.5rem; ">
<section class="widget widget_posts_widget">
<h4><a href="<?php echo get_permalink( $spotlight_id ); ?>">See the Spotlight on this profile</a></h4>