Skip to content

Commit

Permalink
Merge pull request #291 from Automattic/trunk
Browse files Browse the repository at this point in the history
Alpha release Aug 29
  • Loading branch information
leogermani authored Aug 29, 2024
2 parents facd508 + 7bdfb6c commit a21050b
Show file tree
Hide file tree
Showing 16 changed files with 374 additions and 1,031 deletions.
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

0 comments on commit a21050b

Please sign in to comment.