Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alpha release Aug 29 #291

Merged
merged 10 commits into from
Aug 29, 2024
26 changes: 3 additions & 23 deletions includes/class-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,9 @@
*/
final class Core {
/**
* The single instance of the class.
*
* @var Core
*/
protected static $instance = null;

/**
* Main Core instance.
* Ensures only one instance of Core is loaded or can be loaded.
*
* @return Core - Main instance.
*/
public static function instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}

/**
* Constructor.
* Initializer.
*/
public function __construct() {
public static function init() {
\add_action( 'after_setup_theme', [ __CLASS__, 'theme_support' ] );
\add_action( 'wp_enqueue_scripts', [ __CLASS__, 'theme_styles' ] );
\add_action( 'enqueue_block_editor_assets', [ __CLASS__, 'editor_scripts' ] );
Expand Down Expand Up @@ -227,4 +207,4 @@ public static function block_pattern_categories() {
}
}

Core::instance();
Core::init();
27 changes: 3 additions & 24 deletions includes/class-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,9 @@
*/
final class Jetpack {
/**
* The single instance of the class.
*
* @var Jetpack
*/
protected static $instance = null;

/**
* Main Jetpack instance.
* Ensures only one instance of Jetpack is loaded or can be loaded.
*
* @return Jetpack - Main instance.
* Initializer.
*/
public static function instance() {
if ( is_null( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}

/**
* Constructor.
*/
public function __construct() {
public static function init() {
\add_action( 'after_setup_theme', [ __CLASS__, 'theme_support' ] );
\add_filter( 'sharing_show', '__return_false' );
\add_filter( 'sharing_enqueue_scripts', '__return_false' );
Expand All @@ -57,5 +37,4 @@ public static function theme_support() {
\add_theme_support( 'jetpack-geo-location' );
}
}

Jetpack::instance();
Jetpack::init();
Loading