This repository has been archived by the owner on Jun 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
plugin.php
72 lines (58 loc) · 2.29 KB
/
plugin.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
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/**
* Plugin Name: Genesis Tabs
* Plugin URI: https://wordpress.org/plugins/genesis-tabs/
* Description: Genesis Tabs extends the Featured Post widget to create a simple tabbed area.
* Author: StudioPress
* Author URI: https://www.studiopress.com/
* Text Domain: genesis-tabs
*
* Version: 0.9.5
*
* License: GNU General Public License v2.0 (or later)
* License URI: https://opensource.org/licenses/gpl-license.php
*
* @package genesis-tabs
*/
register_activation_hook( __FILE__, 'genesis_tabs_activation_check' );
/**
* This function runs on plugin activation. It checks to make sure the required
* minimum Genesis version is installed. If not, it deactivates itself.
*
* @since 0.9.0
*/
function genesis_tabs_activation_check() {
$latest = '2.5.0';
$genesis = wp_get_theme( 'genesis' );
if ( 'genesis' !== basename( get_template_directory() ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
// Translators: The string is a url to the genesis framework.
wp_die( sprintf( esc_html( __( 'Sorry, you can\'t activate unless you have installed <a href="%s">Genesis</a>', 'apl' ), 'http://www.studiopress.com/themes/genesis' ) ) );
}
if ( version_compare( $genesis->get( 'Version' ), $latest, '<' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) ); // Deactivate ourself.
// Translators: String 1 is a url to the genesis framework. String 2 is the lowest version number required.
wp_die( sprintf( esc_html( __( 'Sorry, you cannot activate without <a href="%1$s">Genesis %2$s</a> or greater', 'apl' ), 'http://www.studiopress.com/support/showthread.php?t=19576', esc_attr( $latest ) ) ) );
}
}
define( 'GENESIS_TABS_PLUGIN_VERSION', '0.9.5' );
define( 'GENESIS_TABS_DIR', plugin_dir_path( __FILE__ ) );
define( 'GENESIS_TABS_URL', plugins_url( '', __FILE__ ) );
require_once GENESIS_TABS_DIR . '/includes/class-genesis-tabs.php';
require_once GENESIS_TABS_DIR . '/includes/class-genesis-tabs-widget.php';
/**
* Helper function to retrieve the static object without using globals.
*
* @since 0.9.4
*/
function genesis_tabs() {
static $object;
if ( null === $object ) {
$object = new Genesis_Tabs();
}
return $object;
}
/**
* Initialize the object on `after_setup_theme`.
*/
add_action( 'after_setup_theme', array( Genesis_Tabs(), 'init' ) );