Yes, get_template_part() does work on Admin pages. Here is how I tested:
Add this to functions.php theme (or child theme) file:
add_action( 'admin_menu', 'wpse_99662_register_admin_test_page' );
function wpse_99662_register_admin_test_page() {
add_menu_page(
'Admin Test Page',
'Admin Test Page',
'manage_options',
'admin_test_page',
'wpse_99662_admin_test_page'
);
}
function wpse_99662_admin_test_page() {
echo '<h2>Admin Test Page</h2>';
get_template_part( 'admin', 'test' );
}
The admin-test.php
file contains the following:
<?php
echo "Loaded admin-test.php<br />";
Related Posts:
- wp_verify_nonce vs check_admin_referer
- if admin is logged in
- Setting admin edit panels & metaboxes positions and visibility for ALL users and admins
- How To Remove WordPress Version From The Admin Footer
- Disable Media Uploads to non Admin Users
- How do I load a CSS style into WordPress admin area only?
- sort child pages on admin
- How to remove list view from media library?
- Add my own button next to “Screen options” and “Help” in the admin
- Are there any action like ‘init_frontend’
- How do I set up the defualt page icon for admin menu?
- Disable all https in WordPress
- Can a users profile be put under the dashboard menu
- Styling Shortcodes in Visual Editor
- WordPress admin screen very slow / timing out when editing or adding a new page/custom post
- turn off new user registration emails
- Send automatic mail to Admin when user/member changes/adds profile
- use add_settings_field properly?
- Is there a hook to put stylesheet and/or JS inside iframes (thickbox or tinyMCE) in admin area
- Thickbox hacking – removing fields
- How to let authors revise other authors drafts, but keep them from publishing?
- Is there a way to prevent author change when editor/administrator edits a post?
- Better search for WordPress admin backend [closed]
- WordPress last login foreach user
- custom tabs in media uploader
- WordPress Left Hand Side Admin Menu Always Collapsed
- How to customize this automatic slug shortener with an overrwrite function
- Hide content-box on specific pages (in admin)?
- Moving a WordPress site to a new server
- Re-ordering Admin Submenu Sections
- How to Remove the “Restore” Link in Quick Edit?
- How to add_filter/action to comment out CSS generated by admin function?
- Remove default WordPress styling from metaboxes on edit post pages?
- Admin Notices coding standard issue
- Is there a way to have admins that are logged in to wordpress not have to enter the password for password protected pages while browsing the website?
- WYSIWYG – Getting the “link” button from HTML mode in Visual mode
- Error thrown. Cannot create references to/from string offsets
- How to receive security update notification email?
- Include admins in author drop-down on edit post screen
- How can I restore admin capabilities?
- How to restrict wp-admin and prevent upload errors
- Adding another “Add Post” button to admin
- Admin page redirect to another admin page
- How to determine if an admin is logged in outside the loop
- What determines whether admin toolbar is shown to a logged-in user?
- Adding text in more than one language (at the same time)
- How to get view count of every page on site and add that (increasing) number to Dashboard Widget
- Restrict function call to page load but not ajax call
- How do I remove All and Published if not admin?
- How to disable https from wordpress site?
- Fatal error: Exception thrown without a stack frame in Unknown on line 0
- Apply permissions per post
- Save author posts as in pending review – block users updating their posts
- Where should I hook into admin?
- Settings API not saving values to database
- Dashboard menu missing
- How to remove wp panel for users
- Unable to upload image using the standard uploader in the WP admin (v4.3)
- Admin role not really admin
- Fixed layout for admin section
- Featured image on post edit page not loading over HTTPS
- Copying WordPress site, HOW about the DB connection?
- How do I diagnose a plugin resource 404?
- Add menu item to edit specific page
- Post editor is 89953px tall. How to fix?
- Does an administrator access allow someone to access to the WordPress database?
- Change Name of Category Heading in New Post
- How to make sure your admin doesn’t hi-jack you site?
- Admin bar is disabled in front
- Load stylesheet on custom admin submenu page
- Disable login on multisite web sites
- Other than save_post any other actions on add / edit post screen?
- Add JavaScript in admin in custom plugin [duplicate]
- Remove iPhone detection on login page
- Dashboard RSS Widget Overhaul
- Possible to show in media library if images are being used as featured images?
- Give admin_menu permission to specific users
- How can all E-mails be sent with BCC copy to Admin?
- How To Create WordPress Dashboard Item
- Login to admin by frontend form?
- Doesn’t call user information to include “wp-load.php” in an external php file
- How do I add an admin table to my page?
- How to save edited post when submitting form
- Show admin bar to editors with Buddypres
- Redirect non-admin after login, and in url – /admin
- Admin hook after editing an image?
- Form submit in admin does not set is_admin() true
- Get the selected posts IDs to use in bulk edit AJAX call
- Disabling “View” mentions from backend?
- Handle logo text color from admin section
- User interfaces living in the Admin “back end” area
- Capability to read/edit page in wp-admin only for administrators
- blank white page in admin, white space hunting?
- WordPress blog code format
- htaccess and htpasswd
- Exclude admin from the top commenters list [duplicate]
- Troubleshooting white screen when editing specific posts
- send information from the thickbox image uploader second tab
- Pull Random Images From Options Page [closed]
- Private messaging plugins + custom admin