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 ); }

Cannot log in to the admin, no error message [closed]

Try to disable the plugins via the database running this query in your MySQL: UPDATE wp_options SET option_value=”a:0:{}” WHERE option_name=”active_plugins”; Also, try to enable error debugging in your wp-config.php file adding this line: define( ‘WP_DEBUG’, true ); Also, could you paste a copy of your .htaccess file?

How to get specific page screen ID

I don’t think it’s possible without accessing a global. This seems to work for all pages types, by using the global $_parent_pages with the function get_plugin_page_hookname: function nackle_get_screen_id( $slug ){ global $_parent_pages; $parent = array_key_exists( $slug, $_parent_pages ) ? $_parent_pages[$slug] : ”; return get_plugin_page_hookname( $slug, $parent ); } Usage example: echo nackle_get_screen_id( ‘my-custom-page-key’ ); Edit- … Read more

Restrict submitters from wp-admin [duplicate]

This is possible, drop this code into your theme’s functions.php file: add_action( ‘init’, ‘wpse_244614_no_dashboard_for_subscriber’ ); function wpse_244614_no_dashboard_for_subscriber() { $to = ‘https://google.com/’; $is_subscriber = current_user_can( ‘subscriber’ ); $in_backend = is_admin(); $doing_ajax = defined( ‘DOING_AJAX’ ) && DOING_AJAX; if ( $is_subscriber && $in_backend && ! $doing_ajax ) { wp_redirect( $to ); exit; } } Now whenever a … 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

Can content be recovered in this situation?

It is hard to guess what kind of a “crash” happened and why did it require the drastic roll back of the site. As far as themes go — they are normally just folders of code (if not going into complicated ones with page builders and such). If that code survived somewhere in your case … Read more

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