wordpress - Adding `post_author` in php -
so, have following markup show shortcode:
<div class="my_edit_button"> <?php echo do_shortcode('[something]'); ?> </div>
then trying make shortcode shown post author using following:
return ($post->post_author == $current_user->id);
but not sure how incorporate both one.
could me out?
you can control if author current user , if true print button. think can work.
<?php if($post->post_author == $current_user->id): ?> <div class="my_edit_button"> <?php echo do_shortcode('[something]'); ?> </div> <?php endif; ?>
Comments
Post a Comment