在php中添加“post_author”
因此,我使用以下标记来显示短代码:在php中添加“post_author”,php,wordpress,Php,Wordpress,因此,我使用以下标记来显示短代码: <div class="my_edit_button"> <?php echo do_shortcode('[something]'); ?> </div> 但我不知道如何将两者结合在一起 有人能帮我吗?您可以控制作者是否为当前用户,以及是否为真,打印您的按钮。我想这样的办法行得通 <?php if($post->post_author == $current_user->ID): ?> &
<div class="my_edit_button">
<?php echo do_shortcode('[something]'); ?>
</div>
但我不知道如何将两者结合在一起
有人能帮我吗?您可以控制作者是否为当前用户,以及是否为真,打印您的按钮。我想这样的办法行得通
<?php if($post->post_author == $current_user->ID): ?>
<div class="my_edit_button">
<?php echo do_shortcode('[something]'); ?>
</div>
<?php endif; ?>
<?php if($post->post_author == $current_user->ID): ?>
<div class="my_edit_button">
<?php echo do_shortcode('[something]'); ?>
</div>
<?php endif; ?>