Edit User Ryan with user id 4321 to have roles Editor only
Outcome: both users (Frank & Ryan) have Editor only roles.
Unsure how/why this is happening.
]]>Created a registration form using Fluent forms (during the registration process Fluent forms stores the user role expiration date in user metadata). Is it possible to change the user role on the specified date using your plugin?
Thank you
]]>Can it be done that the role automatically changes from Member to Subscriber when the package expires?
This is because I need to hide ads based on user roles, i.e., hide ads for members but show them to plain subscribers. Is that possible to do?
Thanks,
Jayanta
Could some one please help out and suggest me whats wrong into below code !
I am putting this action in my theme function.php
function lgbk_add_member( $order_id ) {
$order = new WC_Order( $order_id );
$items = $order->get_items();
foreach ( $items as $item ) {
$product_name = $item['name'];
$product_id = $item['product_id'];
$product_variation_id = $item['variation_id'];
}
if ( $order->user_id > 0 && $product_id == '48' ) {
update_user_meta( $order->user_id, 'paying_customer', 1 );
$user = new WP_User( $order->user_id );
// Remove role
$user->remove_role( 'subscriber' );
// Add role
$user->add_role( 'contributor' );
}
}
add_action( 'woocommerce_order_status_completed', 'lgbk_add_member' );
Bit More Detail :-
For Example I have three products 1) Basic 2) Premium & 3)Pro ….So when ever “subscriber” user purchases basic product then his role changes to ‘contributor’ automatically once order will be marked completed !
Thanks in Advance
https://www.ads-software.com/plugins/woocommerce/
]]>Have same problem someone? Any idea?
Thanks.
https://www.ads-software.com/extend/plugins/advanced-access-manager/
]]>I have successfully added a new role via a php function that I added in functions.php. My problem is when you go to users list : /wp-admin/users.php
Role column, and the new role is not the same. For example on this image:
https://goo.gl/2iOIB
This is what it should be. The Role Column (with red circle) and the New role (with yellow highlight) should be the same. Using the add_role() function only adds the New Role while the Role Column stays the same as the default, which is “Subscriber“.
I’m not sure what you call that name in the Role Column but any of you know what I need to add in my function so it would also change? I need it to be the same coz if it’s not, simplepress forum does not recognize the new role.
Thanks in advance!
]]>any workarounds welcome.
thanks in advance!
]]>