48 lines
1.1 KiB
PHP
48 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Smilia\Core;
|
|
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
final class Plugin {
|
|
|
|
private static ?Plugin $instance = null;
|
|
|
|
public static function instance(): Plugin {
|
|
if ( null === self::$instance ) {
|
|
self::$instance = new self();
|
|
}
|
|
return self::$instance;
|
|
}
|
|
|
|
public function register(): void {
|
|
add_action( 'init', array( $this, 'load_textdomain' ) );
|
|
( new Post_Types() )->register();
|
|
( new Meta_Fields() )->register();
|
|
( new Settings() )->register();
|
|
( new Content() )->register();
|
|
( new Blocks() )->register();
|
|
( new Booking() )->register();
|
|
( new Captcha() )->register();
|
|
( new Seo() )->register();
|
|
( new Sitemap() )->register();
|
|
( new I18n() )->register();
|
|
( new Demo_Access() )->register();
|
|
}
|
|
|
|
public function load_textdomain(): void {
|
|
load_plugin_textdomain( 'smilia-core', false, dirname( plugin_basename( SMILIA_CORE_FILE ) ) . '/languages' );
|
|
}
|
|
|
|
public static function activate(): void {
|
|
( new Post_Types() )->register_types();
|
|
flush_rewrite_rules();
|
|
Booking::schedule_cleanup();
|
|
}
|
|
|
|
public static function deactivate(): void {
|
|
flush_rewrite_rules();
|
|
Booking::unschedule_cleanup();
|
|
}
|
|
}
|