Skip to content

Commit

Permalink
Nightly migration build 2.0.0+migration.20230615
Browse files Browse the repository at this point in the history
  • Loading branch information
ClassyBot committed Jun 16, 2023
1 parent 0c8a964 commit 599254d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 41 deletions.
3 changes: 1 addition & 2 deletions wordpress/wp-admin/includes/class-wp-screen.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,7 @@ public function in_admin( $admin = null ) {
* @return bool False.
*/
public function is_block_editor( ...$args ) {
global $wp_compat;
$wp_compat->using_block_function();
WP_Compat::using_block_function();
return false;
}

Expand Down
18 changes: 6 additions & 12 deletions wordpress/wp-includes/classicpress/class-wp-block-type.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,31 @@

class WP_Block_Type {
public function __set( $name, $value ) {
global $wp_compat;
$wp_compat->using_block_function();
WP_Compat::using_block_function();
}

public function __get( $name ) {
global $wp_compat;
$wp_compat->using_block_function();
WP_Compat::using_block_function();
return false;
}

public function __isset( $name ) {
global $wp_compat;
$wp_compat->using_block_function();
WP_Compat::using_block_function();
return false;
}

public function __unset( $name ) {
global $wp_compat;
$wp_compat->using_block_function();
WP_Compat::using_block_function();
return false;
}

public function __call( $name, $arguments ) {
global $wp_compat;
$wp_compat::using_block_function();
WP_Compat::using_block_function();
return false;
}

public static function __callstatic( $name, $arguments ) {
global $wp_compat;
$wp_compat::using_block_function();
WP_Compat::using_block_function();
return false;
}
}
35 changes: 15 additions & 20 deletions wordpress/wp-includes/classicpress/class-wp-compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@

class WP_Compat {

public $blocks_compatibility_level = null;
public static $blocks_compatibility_level = null;

public function __construct() {

if ( null === $this->blocks_compatibility_level ) {
$this->blocks_compatibility_level = (int) get_option( 'blocks_compatibility_level', 1 );
if ( null === self::$blocks_compatibility_level ) {
self::$blocks_compatibility_level = (int) get_option( 'blocks_compatibility_level', 1 );
}

add_action( 'update_option_blocks_compatibility_level', array( $this, 'purge_options' ), 10, 2 );

if ( 0 === $this->blocks_compatibility_level ) {
if ( 0 === self::$blocks_compatibility_level ) {
return;
}

$this->define_polyfills();

if ( 1 === $this->blocks_compatibility_level ) {
if ( 1 === self::$blocks_compatibility_level ) {
return;
}

Expand Down Expand Up @@ -173,7 +173,7 @@ public function using_block_function_theme() {
* @param string $path
* @return string
*/
private function plugin_folder( $path ) {
private static function plugin_folder( $path ) {
return preg_replace( '~^' . preg_quote( WP_PLUGIN_DIR ) . preg_quote( DIRECTORY_SEPARATOR ) . '([^' . preg_quote( DIRECTORY_SEPARATOR ) . ']*).*~', '$1', $path );
}

Expand All @@ -194,8 +194,8 @@ public function delete_themes_using_blocks() {
*
* @return void
*/
public function using_block_function() {
if ( 2 !== $this->blocks_compatibility_level ) {
public static function using_block_function() {
if ( 2 !== self::$blocks_compatibility_level ) {
return;
}

Expand All @@ -221,14 +221,14 @@ public function using_block_function() {
$traces = array_column( $trace, 'file' );
$traces = array_map(
function( $path ) {
return $this->plugin_folder( $path );
return self::plugin_folder( $path );
},
$traces
);
$active = wp_get_active_and_valid_plugins();
$active = array_map(
function( $path ) {
return $this->plugin_folder( $path );
return self::plugin_folder( $path );
},
$active
);
Expand Down Expand Up @@ -263,8 +263,7 @@ private function define_polyfills() {
* @return bool False.
*/
function register_block_type( ...$args ) {
global $wp_compat;
$wp_compat->using_block_function();
WP_Compat::using_block_function();
return false;
}
}
Expand All @@ -278,8 +277,7 @@ function register_block_type( ...$args ) {
* @return bool False.
*/
function register_block_type_from_metadata( ...$args ) {
global $wp_compat;
$wp_compat->using_block_function();
WP_Compat::using_block_function();
return false;
}
}
Expand All @@ -293,8 +291,7 @@ function register_block_type_from_metadata( ...$args ) {
* @return bool False.
*/
function has_block( ...$args ) {
global $wp_compat;
$wp_compat->using_block_function();
WP_Compat::using_block_function();
return false;
}
}
Expand All @@ -308,8 +305,7 @@ function has_block( ...$args ) {
* @return bool False.
*/
function has_blocks( ...$args ) {
global $wp_compat;
$wp_compat->using_block_function();
WP_Compat::using_block_function();
return false;
}
}
Expand All @@ -323,8 +319,7 @@ function has_blocks( ...$args ) {
* @return bool False.
*/
function register_block_pattern( ...$args ) {
global $wp_compat;
$wp_compat->using_block_function();
WP_Compat::using_block_function();
return false;
}
}
Expand Down
10 changes: 5 additions & 5 deletions wordpress/wp-includes/formatting.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wordpress/wp-includes/script-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function classicpress_asset_version( $type = 'script', $handle = null ) {
static $default_version;

if ( empty( $default_version ) ) {
$default_version = 'cp_b168a597';
$default_version = 'cp_d3376f72';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion wordpress/wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*
* @global string $cp_version
*/
$cp_version = '2.0.0+migration.20230614';
$cp_version = '2.0.0+migration.20230615';

/**
* The WordPress version string.
Expand Down

0 comments on commit 599254d

Please sign in to comment.