Change admin startpage to Pages-page?

This should work for you if you put it in your themes functions.php file, but you may want to modify the conditions, and the url to redirect to depending on your set up. function loginRedirect( $redirect_to, $request, $user ){ if( is_array( $user->roles ) ) { // check if user has a role return “/wp-admin/edit.php?post_type=page”; } … Read more

How to enable Admins to see Plugins

Have a look at the Network Admin Settings screen (in my installation, it’s at example.com/wp-admin/network/settings.php). Tucked away down near the bottom is this: Menu Settings Enable administration menus [] Plugins Checking that box should allow your users to see the Plugins menu in their sites’ back end. (I don’t think it’ll allow them to install … Read more

Custom WP_List_Table displays blank rows

You’re getting the blank rows because your column headers are registered late. And you should register the headers (i.e. initialize the list table class instance) before admin notices are rendered on the page, i.e. before WordPress fires hooks like admin_notices. But your customer_list_page() function, which I believe, is a callback for either add_menu_page() or add_submenu_page(), … Read more

How to add HTML / Form to an Admin Bar Menu

I just gave this a shot and it seemed to work fine: function wpse_form_in_admin_bar() { global $wp_admin_bar; $wp_admin_bar->add_menu( array( ‘id’ => ‘wpse-form-in-admin-bar’, ‘parent’ => ‘top-secondary’, ‘title’ => ‘<form><input type=”text” /><input type=”submit” /> </form>’ ) ); } add_action( ‘admin_bar_menu’, ‘wpse_form_in_admin_bar’ ); You’ll have to do some work to gussy it up a bit, but it looks … Read more

How do I only load a plugin js on it’s settings pages?

You need to use a plugin page-specific script enqueue hook. Edit Best-practice method is to use admin_enqueue_scripts-{hook}, rather than admin_print_scirpts-{hook}. But, because you’re targeting your own Plugin’s admin page specifically, either one is perfectly fine. The hook to avoid is the “global” admin_print_scripts. Original The call would look like this: /* Using registered $page handle … Read more

Admin Post Update Redirection to Posts Screen

Use the redirect_post_location filter and admin_url() function. add_filter( ‘redirect_post_location’, ‘wpse_124132_redirect_post_location’ ); /** * Redirect to the edit.php on post save or publish. */ function wpse_124132_redirect_post_location( $location ) { if ( isset( $_POST[‘save’] ) || isset( $_POST[‘publish’] ) ) return admin_url( “edit.php” ); return $location; } To redirect to a different url, add everything after the … Read more