Support » Plugin: Expire Users » Programmatically Set Default Expiry

  • Hi,

    I’m trying to programmatically set the default expiry data by trying to update the data in the options table. Unfortunately, the info isn’t updating and I’ve no idea why.

    Here’s my code:

    $metaDefaultSerial = array(
    		'auto_expire_registered_users' => /*$old_expire_data['auto_expire_registered_users']*/ 'Y',
    		'expire_user_date_type' => 'on', //ensure we use our custom date
    		'expire_user_date_in_num' => /*$old_expire_data['expire_user_date_in_num']*/ '365',
    		'expire_user_date_in_block' => /*$old_expire_data['expire_user_date_in_block']*/ 'days',
    		'expire_timestamp' => strtotime($acf_expireDate), //set our custom date based on current date
    		'expire_user_role' => 'subscriber', //ensure old members all get same role
    		'expire_user_email' => /*$old_expire_data['expire_user_email']*/ 'Y',
    		'expire_user_email_admin' => /*$old_expire_data['expire_user_email_admin']*/ 'Y',
    		'expire_user_reset_password' => 'N',
    		'expire_user_remove_expiry' => 'Y'
    	//deactivate_plugins( 'expire-users/expire-users.php', 1, 0 );
    	update_option('expire_users_default_expire_settings', $metaDefaultSerial);

    Any idea why this isn’t working? The date never changes and the other fields don’t appear to be taking effect. When I go to create a new user the date option always appears as 1 week from now.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Programmatically Set Default Expiry’ is closed to new replies.