Skip to content

Commit

Permalink
Added documentation to the new install / update methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Olbekson committed Apr 4, 2014
1 parent 65a328a commit ec61422
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions includes/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class WP_Stream_Install {

/**
* URL to the Stream Admin settings page.
*
* @access public
* @var string
*/
Expand Down Expand Up @@ -59,7 +60,6 @@ public static function get_instance() {
* Sets static class properties
*/
function __construct() {

global $wpdb;
self::$current = WP_Stream::VERSION;

Expand All @@ -83,7 +83,6 @@ function __construct() {
* If database update required admin notice will be given
* on the plugin update screen
*
* @action pre_current_active_plugins
* @return null
*/
private static function check() {
Expand Down Expand Up @@ -115,6 +114,11 @@ public static function prompt_update() {
<?php
}

/**
* When user initiates a database update this function calls the update methods, checks for success
* updates the stream_db version number in the database and outputs a success and continue message
*
*/
public static function prompt_update_status() {
$success_db = self::update( self::$db_version, self::$current );
if ( $success_db && self::$current === $success_db ) {
Expand All @@ -134,6 +138,12 @@ public static function prompt_update_status() {
<?php
}

/**
* Added to the admin_notices hook when file plugin version is higher than database plugin version
*
* @action admin_notices
* @return void
*/
public static function update_notice_hook() {
if ( ! isset( $_REQUEST['wp_stream_update'] ) ) {
self::prompt_update();
Expand Down

0 comments on commit ec61422

Please sign in to comment.