wp-liveticker/includes/class-wpliveticker2-system.php
Stefan Kalscheuer f831027aec Begin transformation into classes
Grouped single PHP files with various funcitons into classes for basic, admin and system scope.
2017-11-11 21:44:08 +01:00

42 lines
837 B
PHP

<?php
/**
* WP Liveticker 2: Plugin system class.
*
* This file contains the derived class for the plugin's system operations.
*
* @package WPLiveticker2
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
/**
* WP Liveticker 2 system configuration.
*
*/
class WPLiveticker2_System extends WPLiveticker2 {
/**
* Activation hook.
*
* Initializes default options.
*
* @return void
*/
public static function activate() {
// Load current options.
self::update_options();
// Add default settings to database.
$defaults = self::default_options();
if ( self::$_options['reset_settings'] ) {
// Reset requested, overwrite existing options with default.
update_option( self::OPTION, $defaults );
} else {
// Otherwise add new options.
add_option( self::OPTION, $defaults );
}
}
}