Initial plugin commit
This commit is contained in:
43
includes/Activator.php
Normal file
43
includes/Activator.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
/**
|
||||
* Plugin activation handler.
|
||||
*
|
||||
* @package KGV\VereinManager
|
||||
*/
|
||||
|
||||
namespace KGV\VereinManager;
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
class Activator {
|
||||
|
||||
/**
|
||||
* Activate plugin.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function activate() {
|
||||
Schema::create_tables();
|
||||
Roles::add_roles_and_caps();
|
||||
|
||||
$defaults = array(
|
||||
'allow_multiple_member_parcels' => 1,
|
||||
'water_usage_alert_threshold' => 25,
|
||||
'power_usage_alert_threshold' => 1000,
|
||||
'power_unit' => 'kwh',
|
||||
'pdf_club_name' => get_bloginfo( 'name' ),
|
||||
'pdf_logo_url' => '',
|
||||
'pdf_contact_block' => '',
|
||||
'pdf_intro_text' => __( 'Diese Jahresabrechnung wurde automatisch mit der KGV Vereinsverwaltung erstellt.', KGVVM_TEXT_DOMAIN ),
|
||||
'pdf_footer_text' => __( 'Bitte prüfen Sie die Angaben und melden Sie Rückfragen an den Vorstand.', KGVVM_TEXT_DOMAIN ),
|
||||
);
|
||||
|
||||
$settings = get_option( 'kgvvm_settings', array() );
|
||||
update_option( 'kgvvm_settings', wp_parse_args( $settings, $defaults ), false );
|
||||
update_option( 'kgvvm_plugin_version', KGVVM_VERSION, false );
|
||||
|
||||
Plugin::ensure_daily_optimization_schedule();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user