Plugin Directory

Changeset 2109624


Ignore:
Timestamp:
06/20/2019 03:27:17 PM (7 years ago)
Author:
frankschrijvers
Message:

Removed genesis_pre function check on activation

Location:
wpstudio-mobile-redirect/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wpstudio-mobile-redirect/trunk/genesis-mobile-redirect.php

    r1835148 r2109624  
    44 * Plugin URI: http://wpstud.io/plugins
    55 * Description: A simple-to-use plugin for setting a different homepage for mobile devices.
    6  * Version: 1.0.1
     6 * Version: 1.1
    77 * Author: Frank Schrijvers
    88 * Author URI: http://www.wpstud.io
     
    4646}
    4747
    48 register_activation_hook( __FILE__, 'gmr_activation_check' );
    49 /**
    50  * This function runs on plugin activation. It checks to make sure the required
    51  * minimum Genesis version is installed. If not, it deactivates itself.
    52  */
    53 function gmr_activation_check() {
    5448
    55     $latest = '2.0';
    56     $theme_info = wp_get_theme( 'genesis' );
    57 
    58     if ( ! function_exists( 'genesis_pre' ) ) {
    59 
    60         deactivate_plugins( plugin_basename( __FILE__ ) ); // Deactivate plugin.
    61         /* translators: Genesis Framework version check. */
    62         wp_die( sprintf( __( 'Sorry, you can\'t activate %1$sGenesis Slide-in Widget unless you have installed the %3$sGenesis Framework%4$s. Go back to the %5$sPlugins Page%4$s.', 'wpstudio-mobile-redirect' ), '<em>', '</em>', '<a href="http://www.studiopress.com/themes/genesis" target="_blank">', '</a>', '<a href="javascript:history.back()">' ) );
    63     }
    64 
    65 
    66     if ( version_compare( $theme_info['Version'], $latest, '<' ) ) {
    67 
    68         deactivate_plugins( plugin_basename( __FILE__ ) ); // Deactivate plugin.
    69         /* translators: Genesis Framework version check. */
    70         wp_die( sprintf( __( 'Sorry, you can\'t activate %1$sGenesis Slide-in Widget unless you have installed the %3$sGenesis %4$s%5$s. Go back to the %6$sPlugins Page%5$s.', 'wpstudio-mobile-redirect' ), '<em>', '</em>', '<a href="http://www.studiopress.com/themes/genesis" target="_blank">', $latest, '</a>', '<a href="javascript:history.back()">' ) );
    71 
    72     }
    73 
    74 }
    75 
    76 add_action( 'after_switch_theme', 'gmr_deactivate_check' );
    77 /**
    78  * This function runs on plugin deactivation.
    79  */
    80 function gmr_deactivate_check() {
    81 
    82     if ( ! function_exists( 'genesis_pre' ) ) {
    83         deactivate_plugins( plugin_basename( __FILE__ ) ); // Deactivate plugin
    84     }
    85 
    86 }
    87 
    88 add_action( 'after_setup_theme', 'gmr_init' );
     49add_action( 'genesis_setup', 'gmr_init' );
    8950/**
    9051 * Load required files.
  • wpstudio-mobile-redirect/trunk/readme.txt

    r1835148 r2109624  
    33Tags: mobile redirect, redirect, index, mobile, detection, homepage, redirect homepage, mediaqueries, genesis, Genesis Framework, genesiswp
    44Requires at least: 3.6
    5 Tested up to: 4.9.4
    6 Stable tag: 1.0.1
     5Tested up to: 5.2.2
     6Stable tag: 1.1
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    4141== Changelog ==
    4242
     43= 1.1 =
     44* Update: fix for Genesis 3.0
     45* Removed genesis_pre function check on activation
     46
    4347= 1.0.1 =
    4448* Update: fix for Genesis 2.6
Note: See TracChangeset for help on using the changeset viewer.