Additional Expiry Options
-
Hello everyone,
We have added an expiry option filter since Temporary Login Without Password version 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 the$options
key as shown in the example5_minutes_after_access
to consider as the “After Access” option.You can add the above custom code to your site as explained here.
The page I need help with: [log in to see the link]
- The topic ‘Additional Expiry Options’ is closed to new replies.