How to show a gloabl message on a user profile page (in back end)?

add this code to your function.php <?php function showMessage($message, $errormsg = false) { if ($errormsg) { echo ‘<div id=”message” class=”error”>’; } else { echo ‘<div id=”message” class=”updated fade”>’; } echo “<p><strong>$message</strong></p></div>”; } function showAdminMessages() { showMessage(“This is my message.”, true); } add_action(‘admin_notices’, ‘showAdminMessages’); ?>

Toggle User Roles with button

As it happens, I have something very similar on one of my sites to to allow Administrators update some custom user meta. Basically, you need to add an additional column and then populate it with a link to do what you want. When you click the link some jQuery fires of an AJAX request to … Read more

current_user_can() return FALSE but debugging says TRUE

The register_post_type() function takes a post type name as argument for map_meta_cap, where the default is post. Take a look at the internals of get_post_type_capabilities() for extended insights. That should help you to understand how it’s meant to be: function get_post_type_capabilities( $args ) { if ( ! is_array( $args->capability_type ) ) $args->capability_type = array( $args->capability_type, … Read more

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