Remove menus and submenus

Try this: add_action(‘_admin_menu’, ‘remove_editor_submenu’, 1); function remove_editor_submenu() { remove_action(‘admin_menu’, ‘_add_themes_utility_last’, 101); } add_action(‘admin_init’, ‘remove_theme_submenus’); function remove_theme_submenus() { global $submenu; unset($submenu[‘themes.php’][5]); unset($submenu[‘themes.php’][7]); unset($submenu[‘themes.php’][15]); } To disable other submenu names, go to ./wp-admin/menu.php and search for the item(s) you want to disable. EDIT: As far as disabling by username, I would instead add a new capability to … Read more

Is it possible to add a filter for the output of nav-menu items in admin?

These fields are created in Walker_Nav_Menu_Edit::start_el(). To change or to remove them, create a custom walker (example for another walker) that extends Walker_Nav_Menu_Edit and uses other or less fields. Then filter wp_edit_nav_menu_walker and return the class name of your walker. Pseudo-code: class Walker_Nav_Menu_Edit_Simple extends Walker_Nav_Menu_Edit { public function start_el( &$output, $item, $depth = 0, $args … Read more

WordPress Left Hand Side Admin Menu Always Collapsed

This will properly override the user settings to keep the menu collapsed for all users: /** * Reset user setting to always collapse the admin menu. * * @see set_user_setting() */ function wpdocs_always_collapse_menu() { if ( ‘f’ != get_user_setting( ‘mfold’ ) ) { set_user_setting( ‘mfold’, ‘f’ ); } } add_action( ‘admin_head’, ‘wpdocs_always_collapse_menu’ );

How to disable admin flyout menus?

It’s a bit of a workarround but here you go: function remove_flyout() { echo ‘<style type=”text/css”> .js #adminmenu .wp-submenu.sub-open { display: none; } </style>’; } add_action(‘admin_head’, ‘remove_flyout’); Put it in your functions.php

Admin pages have no content

Try going to Tools then Export and export your WordPress site into an XML file. Then delete your WordPress site off your web server and reinstall it. Go Tools > Import and click on import and select the XML file. Reinstalling WordPress should fix your problem.

Plugin development: how to create a form and get custom data?

The details of processing form data is specific to PHP therefore I will not go into it. The WordPress-specific part is that you want your code to be run on the ‘init’ event in order to have access to WordPress functions and globals (such as the users permissions). <?php add_action(‘init’, function(){ $reservation_capacity = sanitize_text_field( $_POST[‘reservation_capacity’] … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)