Hot answers tagged

7

In wp-admin/includes/update.php file if ( current_user_can('update_core') ) $msg = sprintf( __('An automated WordPress update has failed to complete - <a href="%s">please attempt the update again now</a>.'), 'update-core.php' ); else $msg = __('An automated WordPress update has failed to complete! Please notify the site ...


4

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 ...


2

That area of all admin screens is where admin notices are displayed, so you could generate an admin notice. Here's a suitable function and hook: function wpse_233031_admin_notice() { ?> <div class="notice notice-info"> <p>Your message here!</p> </div> <?php } function wpse_233031_hook_admin_notice() { ...


1

There's a combination of two filters, menu_order does the job, but you also use custom_menu_order to enable menu_order. function wpse_233129_custom_menu_order() { return array( 'index.php', 'upload.php' ); } add_filter( 'custom_menu_order', '__return_true' ); add_filter( 'menu_order', 'wpse_233129_custom_menu_order' ); This will put upload.php (the ...


1

You're using $post->ID which is undefined. Try $_GET['post'] instead: // Get Categories if ( is_admin() && isset($_GET['post']) ) { $cats = wp_get_post_categories( (int)$_GET['post'], array( 'fields' => 'all' ) ); $cats = wp_list_pluck( $cats, 'slug' ); foreach ( $cats as $cat ) { $classes .= ' category-' . $cat; } }


1

@bravokeyl is the probably the best answer to your immediate problem. But to address the following: Is there a way to hook into an action or filter and remove ALL the update nag messages for non-admin users? No. Nag messages in WordPress are just a callback to added to the admin_notices hook which print some HTML to the page. They are practically ...



Only top voted, non community-wiki answers of a minimum length are eligible