WP Admin Only Links


/ Published in: PHP
Save to your folder(s)

Down & Dirty Wordpress code to show specific links only to admininstrators. Can be refined using WP roles and Capabilities for more specific needs.


Copy this code and paste it in your HTML
  1. <?php if (current_user_can('manage_options')){ ?>
  2. <a href="/wp-admin">Dashboard</a> - <?php wp_loginout(); ?>
  3. <?php }?>

URL: http://codex.wordpress.org/Roles_and_Capabilities

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.