How can I access profile Admin Colour Scheme

The current active/selected admin color scheme is a user setting, you can get its value with get_user_option( ‘admin_color’ ). $admin_color = get_user_option( ‘admin_color’ ); if you want to access the color scheme for the specific user then pass the user id as second parameter in the get_user_option() function $user1_id = 2; $user1_color = get_user_option( ‘admin_color’, … Read more

How to add a link to the tax term in the admin Edit page?

The dynamic hook {taxonomy}_term_edit_form_top can be used to output a link to the term’s archive page. Since we’re dealing with terms under the genre taxonomy, we will attach our callback to the genre_term_edit_form_top hook. /** * Adds a link to top of edit term form for terms under the * genre taxonomy. * * @param … Read more

WordPress manage users as non admin

First off, there is no generic “manage users” ability. There are several individual abilities under that rubric. See http://codex.wordpress.org/Roles_and_Capabilities Anyway, you have a couple options. You can add certain capabilities to existing users or you can create a new custom role with the capabilities you need. If a brand new role is needed, one can … Read more

How to add_filter/action to comment out CSS generated by admin function?

I think you can do it like this: function my_admin_bar_init() { remove_action(‘wp_head’, ‘_admin_bar_bump_cb’); } add_action(‘admin_bar_init’, ‘my_admin_bar_init’); Add this to your functions.php file. It will disable outputting of these inline styles in <head> section but the wp_admin_bar will be still available. If you would like to disable wp_admin_bar entirely, you can do it like this: remove_action( … Read more

Different color admin bars for dev, staging and production

You can use a filter to set the admin color scheme, which includes colors for the admin bar: <?php // add a filter add_filter(‘get_user_option_admin_color’, ‘wpse_313419_conditional_admin_color’); // function wpse_313419_conditional_admin_color($result) { // Dev: use ‘light’ color scheme if(get_site_url() == ‘http://dev.example.com’) { return ‘light’; // Staging: use ‘blue’ color scheme } elseif(get_site_url() == ‘http://staging.example.com’) { return ‘blue’; // … Read more

Get email address of type Administrator

You can use this function to get email of all the Administrator on a WordPress website function get_administrator_email(){ $blogusers = get_users(‘role=Administrator’); //print_r($blogusers); foreach ($blogusers as $user) { echo $user->user_email; } }

Modify links under ‘help section’?

But for plugin pages,I can’t able to find the files to remove. For dealing with plugin/registered pages that you won’t necessarily know the hooks for, something like this will work… add_action( ‘admin_head’, ‘set_plugin_help_text’); function set_plugin_help_text() { global $_registered_pages; if( !empty( $_registered_pages ) ) foreach( array_keys( $_registered_pages ) as $hook ) add_contextual_help( $hook, “Your generic plugin … Read more

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