Skip to content

Commit

Permalink
Syncing 1.8.0.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanrice committed Aug 8, 2013
1 parent a35ef35 commit a3b8c5a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 17 deletions.
38 changes: 23 additions & 15 deletions plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Author: Nathan Rice
Author URI: http://www.nathanrice.net/
Version: 1.8.0.1
Version: 1.8.0.2
License: GNU General Public License v2.0 (or later)
License URI: http://www.opensource.org/licenses/gpl-license.php
Expand All @@ -18,27 +18,31 @@

register_activation_hook( __FILE__, 'simplehooks_activation' );
/**
* This function runs on plugin activation. It checks to make sure the required
* minimum Genesis version is installed. If not, it deactivates itself.
* This function runs on plugin activation. It checks to make sure Genesis
* or a Genesis child theme is active. If not, it deactivates itself.
*
* @since 0.1.0
*/
function simplehooks_activation() {

$latest = '1.8.0';

$theme_info = get_theme_data( TEMPLATEPATH . '/style.css' );

if ( 'genesis' != basename( TEMPLATEPATH ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
wp_die( sprintf( __( 'Sorry, you can\'t activate unless you have installed <a href="%s">Genesis</a>', 'simplehooks' ), 'http://www.studiopress.com/themes/genesis' ) );
}
if ( 'genesis' != basename( TEMPLATEPATH ) ) {
simplehooks_deactivate( '1.8.0', '3.3' );
}

if ( version_compare( $theme_info['Version'], $latest, '<' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ) ); /** Deactivate ourself */
wp_die( sprintf( __( 'Sorry, you cannot activate without <a href="%s">Genesis %s</a> or greater', 'simplehooks' ), 'http://www.studiopress.com/support/showthread.php?t=19576', $latest ) );
}
}

/**
* Deactivate Simple Hooks.
*
* This function deactivates Simple Hooks.
*
* @since 1.8.0.2
*/
function simplehooks_deactivate( $genesis_version = '1.8.0', $wp_version = '3.3' ) {

deactivate_plugins( plugin_basename( __FILE__ ) );
wp_die( sprintf( __( 'Sorry, you cannot run Simple Hooks without WordPress %s and <a href="%s">Genesis %s</a>, or greater.', 'simplehooks' ), $wp_version, 'http://www.studiopress.com/support/showthread.php?t=19576', $genesis_version ) );

}

add_action( 'genesis_init', 'simplehooks_init', 20 );
Expand All @@ -48,6 +52,10 @@ function simplehooks_activation() {
* @since 1.8.0
*/
function simplehooks_init() {

/** Deactivate if not running Genesis 1.8.0 or greater */
if ( ! class_exists( 'Genesis_Admin_Boxes' ) )
add_action( 'admin_init', 'simplehooks_deactivate', 10, 0 );

/** Admin Menu */
if ( is_admin() )
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Tags: hooks, genesis, genesiswp, studiopress
Requires at least: 3.3
Tested up to: 3.3.1
Stable tag: 1.8.0.1
Stable tag: 1.8.0.2

This plugin creates a new Genesis settings page that allows you to insert code (HTML, Shortcodes, and PHP), and attach it to any of the 50+ action hooks throughout the Genesis Theme Framework, from StudioPress.

Expand Down Expand Up @@ -114,4 +114,7 @@ The most common request from Genesis users is how to properly modify their foote
* Switched over to the Genesis 1.8 admin menu class to build admin menu.

= 1.8.0.1 =
* Removed an unnecessary version compare check that was causing some fatal errors.
* Removed an unnecessary version compare check that was causing some fatal errors.

= 1.8.0.2 =
* Fixed yet another fatal error but for people using less than Genesis 1.8.0. It should now deactivate gracefully.

0 comments on commit a3b8c5a

Please sign in to comment.