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

How set defaults on wpLink()

Also an small example for change the url in link-button to use the url from installed blog. Use print JS in footer, not an include from js file via wp_enqueue_script() – ist faster vor development, specially for this small requirement, but not so on standard and fine, how the example from the other answer. <?php … Read more

How to order by post meta name in wp admin?

I assume merchant name is another meta field and not the title for that post type? If so, here is a way to organize your admin edit.php area // Add a column in admin edit.php to display the Merchant post type data you want shown add_filter(‘manage_merchant_posts_columns’, ‘admin_merchant_columns’); function admin_merchant_columns( $posts_columns ) { $posts_columns = array( … Read more

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