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

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -