How do I display user name, role and site name using HTML tags inside a dashboard notification?

You can use the bloginfo( ‘name’ ) function to display the site name. Information about the current logged in user can be retrieved using the get_currentuserinfo() function. Here is the fixed code: function my_network_notice(){ global $pagenow, $currentuser; get_currentuserinfo(); if ( $pagenow == ‘index.php’) : ?> <div id=”secondaryBox”> <div id=”author”> <img src=”https://wordpress.stackexchange.com/questions/77448/<?php echo get_stylesheet_directory_uri(); ?>/img/btn-articles-admin.png” width=”40px” … Read more

Allow editors to post iframes [duplicate]

try the iframe shortcode plugin http://wordpress.org/extend/plugins/iframe/ Embed iframe using shortcode [iframe src=”http://player.vimeo.com/video/819138″ width=”100%” height=”480″] ps: you can also use the default oembed shortcode: it supports YouTube, Vimeo, DailyMotion, Flickr, Twitter, … and more. Example: Screenshot: See more here: http://codex.wordpress.org/Embeds

Display User Role Next To Comment

Just pass the user id to this function: function get_role($user_id) { if(is_int($user_id)) { $user = new WP_User( $user_id ); if ( !empty( $user->roles ) && is_array( $user->roles ) ) { foreach ( $user->roles as $role ) echo $role; } } else echo “Something else”; }

Membership subscription, change user role when subscription runs out

Presumably you’ve saved an expiration data somewhere, so setup a wp_cron job to run daily. That job should check the expiration dates, and change the roles for users whose dates are past. if ( ! wp_next_scheduled( ‘alter_user_role_hook’ ) ) { wp_schedule_event( strtotime(‘tomorrow’), ‘daily’, ‘alter_user_role_hook’ ); } function alter_user_role_function() { global $wpdb; $today = date(‘Y-m-d H:i:s’,strtotime(‘today’)); … Read more

Change post status based on user role

I’m then trying to figure out how to change the post status once their subscription is up function downgrade_user_role( $entry, $subscription_id, $transaction_id, $new_payment_amount ) { $user = GFUserData::get_user_by_entry_id( $entry[‘id’] ); $user->set_role( ‘subscriber’ ); global $wpdb; $wpdb->query( $wpdb->prepare( “UPDATE $wpdb->posts SET post_status=”draft” WHERE post_author = %d AND post_status IN (‘publish’, ‘future’)”, $user->ID ) ); } add_action( … Read more

Display user meta by different user role

In your author.php file, get the user metadata via get_user_meta(), then do an if statement of $user->roles == ‘rivenditore’, display the meta data as you desire, and then do an elseif $user->roles == ‘installatori’ statement with what you wish to display for users on other roles. EDIT: Code example as requested: // get author data … Read more

Adding an additional role to an Administrator

use the profile_update hook and in the hooked function, run this check to make sure that it’s adding the previous data to the users profile on update too. if ( $update ){ do_action(‘profile_update’, $user_id, $old_user_data); }else{ do_action(‘user_register’, $user_id); } return $user_id; This answer can help you understand it more: WordPress edit_user_profile_update update secondary role