我需要在我的 wordpress 代码中插入一个“if”控件,因为我希望这个复选框只出现在特定用户身上。但我总是收到一个错误。
<?php if ( !current_user_can('edit_users') ) {
<?php $featured_checked = get_post_meta( $post->ID, '_elist_featured', true ) && 'on' == get_post_meta( $post->ID, '_elist_featured', true ) ? ' checked="checked"' : ''; ?><label for="_elist_featured" class="selectit"><input name="_elist_featured" type="checkbox" id="_elist_featured" <?php echo esc_html( $featured_checked ); ?>><?php esc_html_e( 'This listing is featured.' ); ?></label></div>
} ?>