Please explain what you are trying to do when a user expires.
It looks like you are trying to disassociate a post with ID 22 from a taxonomy?
Thread Starter
khoich
(@khoich)
Yes, I’m trying to disassociate a post with ID 22 from a taxonomy as you said.
But not successful with my code. Post ID 22 still associate with taxonomy after the user expired. Did I use the ‘expire_users_expired’ hook in a wrong way?
Thread Starter
khoich
(@khoich)
OMG. It’s my fault, I try to install the new wordpress and test again.
Everything is working perfectly according to my wish.
Maybe something went wrong in my code.
Thanks for your kind help and thanks for the great plugins.
Hi other time Ben!
The Fist sorry for my English, i’m Sspanish and my English is not very good.
The second thing, thanks for your plugin, it’s great.
I don’t know how tu use the expire_user_expired hook. I need make 2 things, the first:
I’m using your plugin for change the role of the user an i need change the expiration meta_key on user to N, if this value it’s set to Y the user can’t login on the web.
I try with this code on functions.php
function my_expire_users_expired( $user ) {
$wpdb->query("UPDATE $wpdb->usersmeta SET meta_value = 'N' WHERE user_id = $expired_user AND meta_key = '_expire_user_expired'");
}
Where I write the add_action? If i put the add_action code on fucntions.php the wordpress don’t work.
The second thing to make when user expired is submit a form with ajax, but this I will make when the first will be OK.
Thanks other time!
The action should work fine in your functions.php file:
function my_expire_users_expired( $user ) {
update_user_meta( $user->user_id, '_expire_user_expired', 'N' );
}
add_action( 'expire_users_expired', 'my_expire_users_expired' );
Don’t work π
I put your code at the end of the functions.php
I have wordpress 3.7.1 es_ES, Expire users plugins
I need download anything else?
Is the role changing OK?
Try:
function my_expire_users_expired( $user ) {
$user->remove_expire_date();
$user->save_user();
}
add_action( 'expire_users_expired', 'my_expire_users_expired' );
Yes, the role is changin OK. I needed follow this steps for the cron 4 days ago.
If i write your code
function my_expire_users_expired( $user ) {
$user->remove_expire_date();
$user->save_user();
}
add_action( 'expire_users_expired', 'my_expire_users_expired' );
in /wp-includes/functions.php the web don’t works, only show a white color. No error, no text, nothing only the white color. If I del the add_action line on fuctions.php the web works but when the user expire nothing happens.
Thanks π
It should be in your theme’s function.php file in /wp-content/themes/your-theme
Yes! It’s solved π
The code must be in function.php of our theme.
Thanks!