Add plugin, update README
This commit is contained in:
parent
529ec89824
commit
04d30ea2dd
@ -1,2 +1,5 @@
|
||||
# biscotti
|
||||
Biscotti bakes your WordPress logged in user cookie for an extended period of time.
|
||||
# Biscotti
|
||||
|
||||
Biscotti is a plugin that changes the expiration of the logged in user cookie in WordPress to one year. Because some people hate entering their passwords.
|
||||
|
||||
To install this plugin, drop `biscotti.php` into your site's `wp-content/mu-plugins` directory.
|
||||
|
39
biscotti.php
Normal file
39
biscotti.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* Biscotti
|
||||
*
|
||||
* Biscotti is a plugin that changes the expiration of the logged in user
|
||||
* cookie in WordPress to one year. Because some people hate entering
|
||||
* their passwords.
|
||||
*
|
||||
* @link https://github.com/boogah/biscotti
|
||||
* @package Biscotti
|
||||
* @author Jason Cosper <boogah@gmail.com>
|
||||
* @license GPL-3.0
|
||||
*
|
||||
* @wordpress-plugin
|
||||
* Plugin Name: Biscotti
|
||||
* Plugin URI: https://github.com/boogah/biscotti
|
||||
* Description: Bakes your cookie for an extended period of time.
|
||||
* Version: 1.0.0
|
||||
* Author: Jason Cosper
|
||||
* Author URI: https://jasoncosper.com/
|
||||
* License: GPL-3.0
|
||||
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
||||
*/
|
||||
|
||||
// If this file is called directly, abort.
|
||||
if ( ! defined( 'WPINC' ) ) {
|
||||
die;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the login cookie's expiration date to one year.
|
||||
*
|
||||
* @since 1.0.0
|
||||
* @param int $expirein Seconds.
|
||||
*/
|
||||
function biscotti_wp_cookie_logout( $expirein ) {
|
||||
return 31556926;
|
||||
}
|
||||
add_filter( 'auth_cookie_expiration', 'biscotti_wp_cookie_logout' );
|
Loading…
x
Reference in New Issue
Block a user