What exact CSS minifier does WP core use?

Before: add_action(‘admin_head’, function(){ ?> <style type=”text/css”> #wpadminbar #wp-admin-bar-wp-logo > .ab-item .ab-icon::before { content: “LOL”; top: 2px; } </style> <?php }); After: You may also use admin_enqueue_scripts action hook: function my_enqueue($hook) { wp_enqueue_style( ‘my_custom_script’, plugin_dir_url( __FILE__ ) . ‘my-style.css’ ); } add_action( ‘admin_enqueue_scripts’, ‘my_enqueue’ ); See: https://codex.wordpress.org/Plugin_API/Action_Reference/admin_enqueue_scripts …didn’t even have to hack a core file. That … Read more

Simple/basic use of get_current_screen

I haven’t tested this but theoretically you could do something like this (Using the Codex as an Example): function load_custom_wp_admin_style() { $pageArr = array(1, 2, 3); if(isset($_GET[‘post’]) && in_array($_GET[‘post’], $pageArr)){ wp_register_style( ‘custom_wp_admin_css’, get_template_directory_uri() . ‘/admin-style.css’, false, ‘1.0.0’ ); wp_enqueue_style( ‘custom_wp_admin_css’ ); } } add_action( ‘admin_enqueue_scripts’, ‘load_custom_wp_admin_style’ ); We get the current screen and set the … Read more

How to hide menu on WordPress admin

You can do this with remove_menu_page. Add the appropriate menu slug in your functions.php of your theme or your plugin. <?php remove_menu_page( $menu_slug ) ?> Note that users can still access these menus using a direct link. If you intend to block a user from accessing a menu, you will have to set up a … Read more

How to add custom css to login and admin?

That’s pretty fine and it’s the proper way to add CSS to login page. But you can also change login page CSS by below code- function the_dramatist_custom_login_css() { echo ‘<style type=”text/css”> //Write your css here </style>’; } add_action(‘login_head’, ‘the_dramatist_custom_login_css’); This actually prints CSS code inline in the login page. And for admin CSS your way … Read more

Add visit site to your toolbar instead of being in the dropdown

Not complicated, but a little tricky to get timing right. Something like this should work, but you might need to experiment with priority to get the link to specific position on the bar: add_action( ‘admin_bar_menu’, function ( $wp_admin_bar ) { if ( ! is_admin() ) { return; } /** @var WP_Admin_Bar $wp_admin_bar */ $wp_admin_bar->remove_node( ‘view-site’ … Read more

How do i use fontawesome icons in TinyMce editor?

You wouldn’t be able to add a FontAwesome icon by passing it directly to the ed.addButton(); method unfortunately. You can try a workaround however. If you leave the image : url+’/youtube.png’ parameter out of the method then it will automatically create an empty <span> with the class of mceIcon & another class of mce_[plugin_name]. You … Read more

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