How to check if user is in back end?
Use is_admin(). It checks if you’re viewing an Admin page, means the backend.
Use is_admin(). It checks if you’re viewing an Admin page, means the backend.
admin-ajax.php is part of the WordPress AJAX API, and yes, it does handle requests from both backend and front. Try not to worry about the fact that it is in wp-admin. I think that is a strange place for it too, but it is not a security problem in itself. How this relates to “enumerate … Read more
You need just two steps: Hook into the action admin_menu, register the page with a callback function to print the content. In your callback function load the file from plugin_dir_path( __FILE__ ) . “included.html”. Demo code: add_action( ‘admin_menu’, ‘wpse_91693_register’ ); function wpse_91693_register() { add_menu_page( ‘Include Text’, // page title ‘Include Text’, // menu title ‘manage_options’, … Read more
I had the same problem, and Google lead me here. Unfortunately none of these answers helped, but I ultimately figured out the answer, and it’s quite easy! First, enqueue a JavaScript file (I won’t rehash this process; there are many tutorials that can describe this process better than I). I hooked into admin_enqueue_scripts, and it … Read more
/** * Redirect admin pages. * * Redirect specific admin page to another specific admin page. * * @return void * @author Michael Ecklund * */ function disallowed_admin_pages() { global $pagenow; # Check current admin page. if ( $pagenow == ‘edit.php’ && isset( $_GET[‘post_type’] ) && $_GET[‘post_type’] == ‘page’ ) { wp_redirect( admin_url( ‘/post-new.php?post_type=page’ ) … Read more
You can’t pull it in wp-admin you actually have to go look at the plugin in wordpress repository and see if they added there or to the plugin author’s site for a changelog. That would be a nice feature for the future.
Positions for Core Menu Items 2 Dashboard 4 Separator 5 Posts 10 Media 15 Links 20 Pages 25 Comments 59 Separator 60 Appearance 65 Plugins 70 Users 75 Tools 80 Settings 99 Separator Parameter description for “menu position” $position (integer) (optional) The position in the menu order this menu should appear. By default, if this … Read more
Admin pages don’t use the body_class filter, use the admin_body_class filter to add classes to admin body tag instead. Note that $classes in that case is a string, not an array.
Give the anchor a class of thickbox and make sure that the thickbox script is enqueued on your admin page using add_thickbox add_thickbox(); and <a href=”https://wordpress.stackexchange.com/questions/48514/your url” class=”thickbox”>click here</a> You can see what add_thickbox does here: http://hitchhackerguide.com/2011/02/11/add_thickbox/
Hi @Tom, If I understand your question correctly you don’t so much need to know how to add a link to the menu (it seems you already know that) but instead need to learn how to get your link to redirect correctly, right? Redirecting to an External URL from an Admin Menu Item If so … Read more