Redirect WordPress login for customers but not admin

After a bit of thinking, I came up with a solution that allows wp-login.php to be redirected for the public/customers, but not for the admin. I did this by getting the referrer URL. Here is my updated code, but I’m open to other ideas. //Redirect for login from wp-login.php to my-account if not admin add_action(‘init’, … Read more

Remove “Filter” Button on All Posts in wp-admin

There isn’t a filter or an action in order to prevent this BUT WordPress adds the post-type slug of the current page post type to the classes in body tag. Also the slug of the page, in your case .edit-php If you want to do it with css (replace {your_post_type} with your post type) body.post-type-{your_post_type}.edit-php … Read more

Slow WP loading due to persistent version check, how to disable?

After searching around, found plugin: Disable WordPress Updates is one of the effective & easy solutions, which also included disable version check to contact https://api.wordpress.com/. PS: really hope WP could include this option for users as well. If there any insightful and explanatory solution, I still prefer to hear, please suggest. (PS: seems WP@SE is … Read more

How to check if a user is in a specific role?

If you only need this for current user current_user_can() accepts both roles and capabilities. UPDATE: Passing a role name to current_user_can() is no longer guaranteed to work correctly (see #22624). Instead, you may wish to check user role: $user = wp_get_current_user(); if ( in_array( ‘author’, (array) $user->roles ) ) { //The user has the “author” … Read more

Line-height of text in wp-admin

This is the CSS you will need: * { line-height: 1.6; } You could add this at “Customize” -> “Additional CSS” but notice that this will affect all elements because of the “*”. You can see more selectors here, for example if you only want it to affect the content of posts, you would do: … Read more