-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgenesis-simple-menus.php
59 lines (48 loc) · 1.39 KB
/
genesis-simple-menus.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
55
56
57
58
59
<?php
/**
* Genesis Simple Menus file.
*
* @package genesis-simple-menus
*/
/**
* Load the plugin file.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'GENESIS_SIMPLE_MENU_SETTINGS_FIELD', 'genesis_simple_menu_settings' );
define( 'GENESIS_SIMPLE_MENU_VERSION', '1.1.3' );
define( 'GENESIS_SIMPLE_MENU_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
define( 'GENESIS_SIMPLE_MENU_PLUGIN_URL', plugins_url( '', __FILE__ ) );
require_once plugin_dir_path( __FILE__ ) . 'includes/class-genesis-simple-menus.php';
/**
* Helper function to retrieve the static object without using globals.
*
* @since 1.0.0
*
* @return object
*/
function genesis_simple_menus() {
static $object;
if ( null === $object ) {
$object = new Genesis_Simple_Menus();
}
return $object;
}
/**
* Initialize the object on `plugins_loaded`.
*/
add_action( 'plugins_loaded', array( Genesis_Simple_Menus(), 'init' ) );
/**
* Initialize checking of plugin updates from WP Engine.
*/
function genesis_simple_menus_check_for_upgrades() {
$properties = array(
'plugin_slug' => 'genesis-simple-menus',
// phpcs:ignore
'plugin_basename' => plugin_basename( dirname( __FILE__ ) . '/simple-menu.php' ),
);
require_once __DIR__ . '/includes/class-genesis-simple-menus-plugin-updater.php';
new Genesis_Simple_Menus_Plugin_Updater( $properties );
}
add_action( 'admin_init', 'genesis_simple_menus_check_for_upgrades' );