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 “posts” from admin but show a custom post

Doing this search, I’ve found this fine answer by Chris_O. There’s even a jQuery solution I proposed there. Anyway, the function remove_menu_page(‘edit.php’); only removes the Posts menu. But, as we learn from Chris answer, remove_menu_page(‘edit.php?post_type=athletes’); removes the Custom Post Type menu. To really block access to the URL, as we’re merely hiding the menu item, … Read more