Allow an editor to change the author
Did you use ‘register_post_type’ ? If yes, you can add on supports parameters => ‘author’ ?
Did you use ‘register_post_type’ ? If yes, you can add on supports parameters => ‘author’ ?
Just guessing, but maybe: $admin = get_role( __( ‘administrator’ ) ); If you’re trying to make sure that WP translates the string for a specific locale, __() will return the translated string. So if get_role(‘administrator’) works and on a French setup get_role(‘administrateur’) would work, then the above code snippet should do what you need.
In your template: // rolename could for e.g. be ‘editor’ or ‘author’ or ‘administrator’ author_can( get_the_ID(), ‘rolename’ ) AND print “<img src=”https://wordpress.stackexchange.com/questions/56658/…” alt=”A kool badge!” />”;
The following code can go in the functions.php file of your theme. However, this kind of operation should not really be bound to a theme. Changing themes would allow the users with your specific role to publish again. Therefore, just put the code in simple plugin. <?php /** * Plugin Name: My specific roles and … Read more
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
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
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”; }
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
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
You could create a new role, say staff, and add the users you want to that specific role. Then link that role a new capability of your choice, e.g. access_staff. Now you have a new role with a new capability, so all you need to do to restrict the access to any part of the … Read more