Additional Expiry Options
-
We have added an expiry options filter since Temporary Login Without Password 1.5.11.
One can add a custom expiry option with the help of the following code.
add_filter( 'tlwp_expiry_options', 'add_tlwp_expiry_option', 10, 1); function add_tlwp_expiry_option( $options ) { // Expire in 5 minutes from now $options['5_minutes'] = array( 'label' => __('5 Minutes', 'text-domain'), 'timestamp' => MINUTE_IN_SECONDS * 5, 'order' => 1 // dropdown options will be sort with this number ); // Expire in 5 minutes after user access the link $options['5_minutes_after_access'] = array( 'group' => 'after_access', 'group_name' => __( 'After Access', 'text-domain'), 'label' => __('5 Minutes', 'text-domain'), 'expiry_label' => __( '10 days after access', 'text-domain' ), 'timestamp' => MINUTE_IN_SECONDS * 5, 'order' => 5 // dropdown options will be sort with this number ); return $options; }
Please make sure you suffix
_after_access
in$options
key like shown in example5_minutes_after_access
to consider as the “After Access” optionThe page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Additional Expiry Options’ is closed to new replies.