Dashboard : remove Safari navigator message

According to that page: http://wpcodesnippet.com/hide-browser-upgrade-warning-wordpress/ You can put this code into your functions.php to get rid of that notices: // hide browser upgrade warning in wordpress function wcs_disable_browser_upgrade_warning() { remove_meta_box( ‘dashboard_browser_nag’, ‘dashboard’, ‘normal’ ); } add_action( ‘wp_dashboard_setup’, ‘wcs_disable_browser_upgrade_warning’ ); I would tell your client the risks that might be comming with this – just to … Read more

How to remove some item from WordPress Dashboard for user Author

Two edits: checking for a role is not recommended, you want to check for a capability instead; and the php file you want to pass is edit-comments.php. <?php add_action( ‘admin_menu’, ‘my_menu_links_removing’, 999 ); function my_menu_links_removing() { if ( ! current_user_can(‘activate_plugins’) ) { remove_menu_page( ‘edit-comments.php’ ); } } ?> Administrators are the only default role (besides … Read more

Block user roles from accessing the WordPress dashboard

You can make an array of the roles that need to be blocked, and use array_intersect() to check if the current user is in any of those roles. function wpse66094_no_admin_access() { $redirect = isset( $_SERVER[‘HTTP_REFERER’] ) ? $_SERVER[‘HTTP_REFERER’] : home_url( “https://wordpress.stackexchange.com/” ); global $current_user; $blocked_roles = array( ‘shopkeeper’, ‘block-this-role’, ‘block-this-role-too’ ); $user_roles = $current_user->roles; // … Read more

WP admin style not refreshing

A more standard way to enqueue stylesheets in WP admin is to use wp_enqueue_style function on admin_enqueue_scripts hook. if I do any changes afterwards it doesnt update This sounds like a browser cache isssue. You can bust the cache by adding a dynamic version number parameter to the stylesheet url with the native php function … Read more

Backend Checkboxes working – but not visual?

The answer for me was related to my web servers Content Security Policy. Needed to add “data:” as a possible source default-src data: ‘self’ *.googleapis.com *.gstatic.com; If you are using more specific CSPs like font-src: and img-src: you may also need to allow it within those as well.

How to create a field in customize and show that in header.php?

add_action( ‘customize_register’, ‘theme_customize_register’ ); /** * Register individual settings through customizer’s API. * * @param WP_Customize_Manager $wp_customize Customizer reference. */ function theme_customize_register( $wp_customize ) { // You can first start by adding a section $wp_customize->add_section( ‘theme_options’, array( ‘title’ => __( ‘Title of your section’, ‘domain’ ), ‘capability’ => ‘edit_theme_options’, ‘description’ => __( ‘Some description’, ‘domain’ … Read more

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