Displaying Admin-Only Content
-
I am trying to display some admin-only content (a button to the admin dashboard) on the accounts page, that I only want visible to the admins.
I have tried several plugins for using php code and tried things like this:
<?php global $user_ID; if( $user_ID ) : ?> <?php if( current_user_can('level_10') ) : ?> <a href="https://yourdomainurl.com/stats/">Stats</a> <?php else : ?> <?php endif; ?> <?php endif; ?>
But no-one ever mentions where to put this code.
I don’t want to start modifying WordPress as the second I update this will all be gone, I need something that will work and that I don’t have to redo every update.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Displaying Admin-Only Content’ is closed to new replies.