Envira Gallery Documentation
Documentation, Reference Materials and Tutorials for Envira Gallery
Documentation, Reference Materials and Tutorials for Envira Gallery
Would you like to control the amount of time your cookie for your password is set for? With a custom plugin you can easily set the cookie time for the Password Protection Addon.
To control the time set for the cookie on the password, just add the following code to a new file at wp-content/plugins/envira-set-password-cookie.php
.
<?php /* * Plugin Name: Envira Gallery - Control Password Cookie Time * Plugin URI: https://enviragallery.com * Description: Plugin that will set the cookie time on your password protected galleries * Author: Envira Gallery Team * Author URI: https://enviragallery.com * Version: 1.0 */ add_filter('envira_password_protection_time_limit', 'test_envira_password_protection_time_limit', 10, 3); function test_envira_password_protection_time_limit( $time_limit, $post, $data ) { // note: you can use $post and $data to individually set time limit based on post ID, gallery data, etc. // time is in seconds, so if you wanted to set the time limit for something very short (like 10 seconds) $time_limit = time() + 10; return $time_limit; }
If you’re unsure how to create a plugin file, follow these steps below:
envira-keyboard-mousewheel-navigation.php
.Your next step is to activate the plugin you just uploaded. Simply navigate to the Plugins from within your WordPress dashboard and activate the Envira Gallery – Control Password Cookie Time plugin.
And that’s it! Would you like to have your gallery titles link when inside an Envira album? Take a look at our article on How to make the gallery titles in your Envira Albums link.