always by default show welcome panel in the dashboard

thanks @birgire with your help i change the code to make this work. everyone that looking for the same solution you can use this code: add_action( ‘load-index.php’, ‘show_welcome_panel’ ); function show_welcome_panel() { $user_id = get_current_user_id(); if ( 1 != get_user_meta( $user_id, ‘show_welcome_panel’, true ) ) update_user_meta( $user_id, ‘show_welcome_panel’, 1 ); }

Remove add_menu()’s second argument from it’s submenus list

Try this: add_menu_page( ‘MDW Config’, ‘MDW Config’, ‘manage_options’, ‘mdw-config’, ‘config_general_info’, ”, 45); add_submenu_page( ‘mdw-config’, ‘General info’, ‘Info’, ‘manage_options’, ‘mdw-config’, ‘config_general_info’); add_submenu_page( ‘mdw-config’, ‘Google Analytics Integration’, ‘Google Analytics’, ‘manage_options’, ‘ga-integration’, ‘config_ga_integration’); What you have to do is simply overwrite the name of your first submenu page by assigning it to the same menu-slug but with different … Read more

How to remove dashboard access (wp-admin) for author but not disable the capabilities?

Use this code in your functions.php file or in a plugin- function wpse_253580_prevent_author_access(){ if( current_user_can( ‘author’ ) && is_admin() ) { // do something here. maybe redirect to homepage wp_safe_redirect( get_bloginfo( ‘url’ ) ); } } add_action( ‘admin_init’, ‘wpse_253580_prevent_author_access’ ); This will check if current user is an author and he is trying to access … Read more

Page code showing in WP Dashboard

Shortcodes should not echo any output. They should always return the text that is to be used to replace the shortcode. You either write the html code on a variable: function my_shortcode() { $output=”<div>something</div>”; return $output; } Or you can use php output buffering: function my_shortcode() { ob_start(); ?> <div>something</div> <?php return ob_get_clean(); } In … Read more

How to Change custom post type Dashicon Color

The menu icons are displayed via CSS in the :before pseudo-element of the .wp-menu-image.dashicons-before wrapper. So first your code needs to target .wp-menu-image:before, or .dashicons-before:before (not .dashicons). This won’t be enough though because default styles in WordPress are using some more specific selectors. Though you could override them with !important and make all icons red … Read more

How do you force the wordpress dashboard to be 1 coulmn by default?

I found a promising looking answer to this question in the following post: http://wordpress.org/support/topic/customizing-admin-area-using-functionsphp-2-questions It recommends using this code in the functions.php file: function so_screen_layout_columns( $columns ) { $columns[‘dashboard’] = 1; return $columns; } add_filter( ‘screen_layout_columns’, ‘so_screen_layout_columns’ ); function so_screen_layout_dashboard() { return 1; } add_filter( ‘get_user_option_screen_layout_dashboard’, ‘so_screen_layout_dashboard’ ); Hope that helps!

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