-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathgenesis-simple-hooks.php
46 lines (38 loc) · 1.21 KB
/
genesis-simple-hooks.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
<?php
/**
* This file handles the creation of the Simple Hooks admin menu.
*
* @package genesis-simple-hooks
*/
define( 'GENESIS_SIMPLE_HOOKS_DIR', plugin_dir_path( __FILE__ ) );
define( 'GENESIS_SIMPLE_HOOKS_URL', plugins_url( '', __FILE__ ) );
define( 'GENESIS_SIMPLE_HOOKS_VERSION', '2.3.1' );
require_once GENESIS_SIMPLE_HOOKS_DIR . '/includes/class-genesis-simple-hooks.php';
/**
* Helper function to retrieve the static object without using globals.
*
* @since 0.9.0
*/
function genesis_simple_hooks() {
static $object;
if ( null === $object ) {
$object = new Genesis_Simple_Hooks();
}
return $object;
}
/**
* Initialize the object on `plugins_loaded`.
*/
add_action( 'plugins_loaded', array( Genesis_Simple_Hooks(), 'init' ) );
/**
* Initialize checking of plugin updates from WP Engine.
*/
function genesis_simple_hooks_check_for_upgrades() {
$properties = array(
'plugin_slug' => 'genesis-simple-hooks',
'plugin_basename' => plugin_basename( dirname( __FILE__ ) . '/plugin.php' ),
);
require_once __DIR__ . '/includes/class-genesis-simple-hooks-plugin-updater.php';
new Genesis_Simple_Hooks_Plugin_Updater( $properties );
}
add_action( 'admin_init', 'genesis_simple_hooks_check_for_upgrades' );