Plugin Directory

Changeset 654925


Ignore:
Timestamp:
01/18/2013 03:50:44 PM (13 years ago)
Author:
micc83
Message:

Adding version 0.0.4 of my plugin

Location:
wpdevtool/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • wpdevtool/trunk/readme.txt

    r654882 r654925  
    77Requires at least: 3.0.1
    88Tested up to: 3.5
    9 Stable tag: 0.0.3
     9Stable tag: 0.0.4
    1010License: GPLv2 or later
    1111License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    5454== Changelog ==
    5555
     56= 0.0.4 =
     57* Fix bug "updating plugin" cause maintenance message and email missing error
     58
    5659= 0.0.3 =
    5760* Fix console showing 1 error with no errors bug
  • wpdevtool/trunk/wpdevtool.php

    r654882 r654925  
    44Plugin URI: https://github.com/micc83/WpDevTool
    55Description: A simple tool to develop on WordPress platform...
    6 Version: 0.0.3
     6Version: 0.0.4
    77Author: Alessandro Benoit
    88Author URI: http://codeb.it
     
    4545
    4646/**
    47  * Set default option values on plugin activation
     47 * Set default option values on first install / version change
    4848 *
    4949 * @since 0.0.2
     
    5151function wpdevtool_set_default_options_value() {
    5252
     53    if ( false === get_option( 'wpdevtool_version' ) ) {
     54        update_option( 'wpdevtool_version', plugin_get_version() );
     55    } elseif ( version_compare( plugin_get_version(), get_option( 'wpdevtool_version' ), '<=' ) ) {
     56        return;
     57    } else {
     58        update_option( 'wpdevtool_version', plugin_get_version() );
     59    }
     60
     61    // The code from here on is executed only on activation and version change:
     62   
    5363    if ( !get_option( 'wpdevtool_maintenance_message' ) )
    5464        update_option( 'wpdevtool_maintenance_message', sprintf( __( '%s is under maintenance at the moment. Contact us at %s', 'wpdevtool' ), '[name]', '[email]' ) );
     
    6070
    6171}
    62 register_activation_hook( __FILE__, 'wpdevtool_set_default_options_value' );
     72add_action( 'admin_init', 'wpdevtool_set_default_options_value' );
    6373
    6474/**
Note: See TracChangeset for help on using the changeset viewer.