WordPress.org

Plugin Directory

Changeset 597840


Ignore:
Timestamp:
09/12/12 06:08:12 (20 months ago)
Author:
solarissmoke
Message:

Add WP version compatibility checking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • disable-comments/trunk/disable-comments.php

    r590475 r597840  
    2121        // load options 
    2222        $this->options = get_option( 'disable_comments_options', array() ); 
     23         
     24        // If it looks like first run, check compat 
     25        if ( empty( $this->options ) && version_compare( $GLOBALS['wp_version'], '3.2', '<' ) ) { 
     26            require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 
     27            deactivate_plugins( __FILE__ ); 
     28            if ( isset( $_GET['action'] ) && ( $_GET['action'] == 'activate' || $_GET['action'] == 'error_scrape' ) ) 
     29                exit( 'Disable Comments requires WordPress version 3.2 or greater.' ); 
     30        } 
    2331         
    2432        $old_ver = isset( $this->options['db_version'] ) ? $this->options['db_version'] : 0; 
Note: See TracChangeset for help on using the changeset viewer.