-
Notifications
You must be signed in to change notification settings - Fork 3
/
entryexpiration.php
54 lines (44 loc) · 1.35 KB
/
entryexpiration.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
Plugin Name: Entry Expiration for Gravity Forms
Plugin URI: https://travislop.es/plugins/gravity-forms-entry-expiration/
Description: Provides a simple way to remove old entries in Gravity Forms.
Version: 2.2.1
Author: CosmicGiant
Author URI: https://cosmicgiant.com
Text Domain: gravity-forms-entry-expiration
**/
define( 'GF_ENTRYEXPIRATION_VERSION', '2.2.1' );
// If Gravity Forms is loaded, bootstrap the Entry Expiration Add-On.
add_action( 'gform_loaded', array( 'GF_EntryExpiration_Bootstrap', 'load' ), 5 );
/**
* Class GF_EntryExpiration_Bootstrap
*
* Handles the loading of Gravity Forms Entry Expiration and registers with the Add-On Framework.
*/
class GF_EntryExpiration_Bootstrap {
/**
* If the Add-On Framework exists, Gravity Forms Entry Expiration is loaded.
*
* @access public
* @static
*/
public static function load() {
// If Add-On Framework is not loaded, exit.
if ( ! method_exists( 'GFForms', 'include_addon_framework' ) ) {
return;
}
require_once( 'class-gf-entryexpiration.php' );
GFAddOn::register( 'GF_Entry_Expiration' );
}
}
/**
* Returns an instance of the GFEntryExpiration class.
*
* @see GF_Entry_Expiration::get_instance()
*
* @return GF_Entry_Expiration|false
*/
function gf_entryexpiration() {
return class_exists( 'GF_Entry_Expiration' ) ? GF_Entry_Expiration::get_instance() : false;
}