73

I was able to fix the error by hotfixing the RevSlider plugin on my server as documented here. In revslider/includes/framework/base-admin.class.php, I changed the following line (l. 21 of my version) from: private static $arrMetaBoxes = ''; //option boxes that will be added to post to: private static $arrMetaBoxes = array(); //option boxes ...


30

Another solution is to add the columns setting back to the settings. function wpse126301_dashboard_columns() { add_screen_option( 'layout_columns', array( 'max' => 2, 'default' => 1 ) ); } add_action( 'admin_head-index.php', 'wpse126301_dashboard_columns' ); There is a related Trac ticket: #...


21

In you PhpMyAdmin query for: (if you have a different database prefix, change that in the query, also change the user_id to yours) SELECT * FROM `wp_usermeta` WHERE `user_id` =1 AND `meta_key` LIKE 'meta-box%' Than delete those values and you will get the original order back. If you only want to change the menu order back for a page than only delete "...


15

As far as ease of use, especially for WordPress Admins not too firm in PHP, I second brasoflo's plugin recommendation (Adminimize). For the sake of completeness, this is how it'd be done programmatically: /* Remove the "Dashboard" from the admin menu for non-admin users */ function wpse52752_remove_dashboard () { global $current_user, $menu, $submenu; ...


14

To achieve adding a custom sortable column to the WP_List_Table of your post type within the WordPress administration back-end dashboard, you will need to do the following: Replace all occurrences of YOUR-POST-TYPE-NAME with your actual post type name. Replace all occurrences of YOUR-TAXONOMY-NAME with your actual taxonomy name. Replace all occurrences of ...


12

You have some messed up code. I have reformatted your code to code which actually works. The following solution allows you to give your Custom Post Type menu a menu name of what ever you want. Just change the label "menu_name". POST TYPE // Create the news custom post type register_post_type('nwcm_news', array( 'labels' => array( '...


10

You have to give the capability a true or false, like this: add_role('user', 'User', array( 'read' => true )); To fix it, first remove the role and than re-add it again. remove_role('user'); add_role('user', 'User', array('read' => true)); http://codex.wordpress.org/Function_Reference/add_role


9

To rename default post type (or any other for that matter) just use filter post_type_labels_{$post_type}. For default post it will be post_type_labels_post. In the code below is the full list of labels (WP 4.7.1). You do not have to change everything. add_filter( 'post_type_labels_post', 'news_rename_labels' ); /** * Rename default post type to news * * @...


9

The best way is to re-direct user logins to your page and also remove the dashboard from the menu, this can be done with 2 filters. Redirect logins to your page edit screen example based on user roles, this example uses "author": function dashboard_redirect($url) { global $current_user; // is there a user ? if(is_array($user->roles)) { ...


9

Updating this answer the original code below will remove the nag screen but it will ping the server for updates on every load, thanks to @ El Yobo, see update below. This will disable the core updates and the nag screen to everyone but superadmins. add_action( 'after_setup_theme', 'remove_core_updates' ); function remove_core_updates() { if ( ! ...


8

This is how you remove DASHBOARD on your Wordpress fully ! For who don't want to use plug-in(s), If you installed a plug-in for remove that. You will get extra menu about that plug-in also. What the point ? So you should have control what you do/did Insert codes on functions.php Redirect : (When user go to url like domain.com/wp-admin) function ...


8

This happens because of the new media queries. A very unfortunate change … Anyway, you can change it by setting a custom width for .postbox-container. Use 50% for two columns and 100 % for just one column. add_action( 'admin_head-index.php', function() { ?> <style> .postbox-container { min-width: 100% !important; } .meta-box-sortables.ui-...


8

Seems like there is no filter for this (yet), but you can unregister the default activity widget and register (within your functions, or even better within your plugin as recommended by Dave Warfel) a similar activity widget with your custom settings: // unregister the default activity widget add_action('wp_dashboard_setup', 'remove_dashboard_widgets' ); ...


8

Check if you or a plugin include bootstrap and the bootstrap CSS / Theme files. Bootstraps .hidden class looks like: .hidden { display: none !important; } But overrides wordpress' definition of .hidden: .hidden { display: none; } The Top 'Help' & 'Screen Options' bars are displayed via inline style display: block, which is overridden by ...


8

Here is the function that I use to display CPT in the "At a glance" widget add_action( 'dashboard_glance_items', 'cpad_at_glance_content_table_end' ); function cpad_at_glance_content_table_end() { $args = array( 'public' => true, '_builtin' => false ); $output = 'object'; $operator = 'and'; $post_types = ...


8

If you want to remove metaboxes from the dashboard page you can add this to functions.php function remove_dashboard_widgets () { remove_meta_box('dashboard_quick_press','dashboard','side'); //Quick Press widget remove_meta_box('dashboard_recent_drafts','dashboard','side'); //Recent Drafts remove_meta_box('dashboard_primary','dashboard','side'); //...


7

I use this command to find all installs of WordPress on my VPS server find /home/*/public_html/ -type f -iwholename "*/wp-includes/version.php" -exec grep -H "\$wp_version =" {} \; Its a really quick way to find out which accounts are out of date.


7

Easy enough, decided to just do the redirect option. I used the wp_login action hook. You could also probably use this for redirecting your users to ANY page on your website. You can also check user capabilities from the $user Object passed in as a function parameter if you want to send different user levels to different pages. /* Redirect the user logging ...


7

From this Q&A, I've learned about the global variable $wp_meta_boxes. And over there is also the code to remove the default meta boxes. After examining the variable, this is the code I wrote to remove all Dashboard Widgets, including the ones added by plugins: add_action('wp_dashboard_setup', 'wpse_73561_remove_all_dashboard_meta_boxes', 9999 ); ...


7

Almost the same approach One Trick Pony has chosen, but I am using translated names and uasort() (to preserve the keys): add_filter( 'editable_roles', 't5_sort_editable_roles' ); /** * Array of roles. * * @wp-hook editable_roles * @param array $roles * @return array */ function t5_sort_editable_roles( $roles ) { uasort( $roles, '...


7

Actually, it is not that hard. The last access time for a user is in get_user_meta( get_current_user_id(), 'last_access', TRUE ). The date of each comment is in the column comment_date. Both share the same format, so we can compare them in SQL with a simple >. There is an action in the Right Now dashboard widget to show additional rows: ...


7

It's simple, just unregister postexcerpt box first then add another one on the top. Here is my code add_action( 'admin_menu', function () { remove_meta_box('postexcerpt', 'post', 'normal'); }, 999 ); add_action('edit_form_after_title', 'post_excerpt_meta_box');


6

Whenever we find ourselves in the situation "there must be a way to overcome this hard-code", jQuery comes to rescue... The Result The Code The following code must be pasted at the end of the active Theme functions.php file. Or it can be used in a custom plugin, which will make the code "theme-independent". add_action('admin_head-index.php', '...


6

add_action( 'load-index.php', 'the_function', 1, 0 ); The load-{page_hook} hook works with the filename of the page to load.


6

You don’t need to invent a new screen option row. Just use proper metaboxes. Currently, you are drawing pseudo-metaboxes: <!-- Post status start--> <div class = "postbox"> <div class = "handlediv"> <br> </div> <h3 class = "hndle"><span><?php _e("By Post Status", 'bulk-delete'); ?&...


6

Inside admin-header.php, there's the following set of hooks: do_action('admin_enqueue_scripts', $hook_suffix); do_action("admin_print_styles-$hook_suffix"); do_action('admin_print_styles'); do_action("admin_print_scripts-$hook_suffix"); do_action('admin_print_scripts'); do_action("admin_head-$hook_suffix"); do_action('admin_head'); The one to always use it ...


6

I adapted from here: https://wordpress.stackexchange.com/a/158485/373 /* ----------------------------------------- * Put excerpt meta-box before editor * ----------------------------------------- */ function my_add_excerpt_meta_box( $post_type ) { if ( in_array( $post_type, array( 'post', 'page' ) ) ) { add_meta_box( 'postexcerpt'...


6

The short answer is: Use Query Strings. If you notice in the address bar immediately after you publish a Post... You will see something similar to this: domain.com/wp-admin/post.php?post=4935&action=edit&message=6 There's a few different Query Variables: post contains the ID of the Post being edited. action is saying we're currently "editing" the ...


6

I have observed the same issue with contact-form-7 a while back. But note that registering shortcodes based on is_admin is doing_it_wrong (see gmazzap`s answer) There are the two reasons that seem legitimate at first sight (and why they are wrong): (Unlikely) The plugin author tried to optimize the script to only register shortcodes when they are needed. ...


6

1) Install & network activate User Role Editor plugin from http://example.com/wp-admin/network/plugins.php 2) Then go to Settings > User Role Editor menu on network and make sure you have the settings as shown in following screenshot. 3) Go to "User Role Editor" settings page on your main site http://example.com/wp-admin/users.php?page=users-user-role-...


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