Check if user is admin by user ID

You worded it as you want to check if user has administrator role. It is considered more proper to check for capability, relevant to specific action. In practice this is usually expressed as current_user_can( ‘manage_options’ ) for current user. For arbitrary user it would be user_can( $user_id, ‘manage_options’ ). Of course this is capability that … Read more

How can I uninstall a language?

I hope you have FTP access or some alike, so you can follow path as shown below. Use any FTP tool (FileZilla or some) and enter your website. 1) Go to the wp-content folder There you will see a folder named languages. 2) Go into the languages folder There you will find a folder called … Read more

How to display a static HTML page while setting up a WordPress site?

Either use a plugin (like wp-maintenance-mode) or hardcode your .htaccess file to redirect to the splash page, and allow your own (or your team) IP address to ignore the redirect. Like this: <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1 RewriteCond %{REQUEST_URI} !/splashpage.html$ [NC] RewriteRule .* /maintenance.html [R=302,L] </IfModule> Regarding your doubt why index.html gets served … Read more

Show all post tags on post edit screen/sidebox

I’d say the easiest way to do it is use the get_terms_args filter and unset the number limit if the context is right (the AJAX request to get the tag cloud): function wpse_64058_all_tags ( $args ) { if ( defined( ‘DOING_AJAX’ ) && DOING_AJAX && isset( $_POST[‘action’] ) && $_POST[‘action’] === ‘get-tagcloud’ ) unset( $args[‘number’] … Read more

Remove dashboard, use Pages tab as default

The best way is to re-direct user logins to your page and also remove the dashboard from the menu, this can be done with 2 filters. Redirect logins to your page edit screen example based on user roles, this example uses “author”: function dashboard_redirect($url) { global $current_user; // is there a user ? if(is_array($current_user->roles)) { … Read more