Reference external file as a function

You can’t. Create a function that loads that file: function load_admin_page_file() { require ‘admin-members.php’; } Then use that function name as callback argument. In PHP 5.3 you can use a lambda: add_menu_page( ‘Members’, ‘Members’, ‘manage_options’, ‘members’, function() { require ‘admin-members.php’; } );

Identify and display the fact that user is admin next to username in comment section

From inside a comment Loop… $author_data = get_user_by(‘login’,$comment->comment_author); if (!empty($author_data)) { var_dump($author_data->roles); } $author_data->roles is an array so you will need to work out what you want to do with that. That is, print them all? Print the highest ranking role? if (array_intersect(array(‘administrator’,’moderator’),$author_data->roles)) { echo ‘admin’; } elseif (array_intersect(array(‘something’,’else’),$author_data->roles)) { echo ‘something else’; }

Custom Form only for admin

Well, it won’t be easy, but you can do this in this way: Add a Custom Post Type (you can restrict access to this CPT for admin only). Use Advanced Custom Fields plugin and create custom fields template for your Custom Post Type from 1. Create a custom page template and place custom query inside … Read more

Link to all posts page?

Your 2nd example omits the leading / in the URL — does /wp-admin/edit.php work? Also, you’re wiser to use admin_url(), since it’s possible to change the Admin URL to something other than /wp-admin. Instead of <a href=”https://wordpress.stackexchange.com/wp-admin/edit.php”>, use <a href=”https://wordpress.stackexchange.com/questions/103685/<?php echo( admin_url(“edit.php’ ) ); ?>”>. It’s more complicated, but much safer.