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

Remove Gutenberg plugin's deprected APIs for version 8.3.0 #23001

Merged
merged 1 commit into from
Jun 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions lib/class-wp-block-patterns-registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,44 +138,3 @@ function register_block_pattern( $pattern_name, $pattern_properties ) {
function unregister_block_pattern( $pattern_name ) {
return WP_Block_Patterns_Registry::get_instance()->unregister( $pattern_name );
}

/**
* Class used for interacting with patterns.
*/
class WP_Patterns_Registry {

/**
* Utility method to retrieve the main instance of the class.
*
* @return WP_Block_Patterns_Registry The main instance.
*/
public static function get_instance() {
_deprecated_function( 'WP_Patterns_Registry', 'Gutenberg 8.3.0', 'WP_Block_Patterns_Registry' );
return WP_Block_Patterns_Registry::get_instance();
}
}

/**
* Registers a new pattern.
*
* @param string $pattern_name Pattern name including namespace.
* @param array $pattern_properties Array containing the properties of the pattern.
*
* @return boolean True if the pattern was registered with success and false otherwise.
*/
function register_pattern( $pattern_name, $pattern_properties ) {
_deprecated_function( __FUNCTION__, 'Gutenberg 8.1.0', 'register_block_pattern()' );
return register_block_pattern( $pattern_name, $pattern_properties );
}

/**
* Unregisters a pattern.
*
* @param string $pattern_name Pattern name including namespace.
*
* @return boolean True if the pattern was unregistered with success and false otherwise.
*/
function unregister_pattern( $pattern_name ) {
_deprecated_function( __FUNCTION__, 'Gutenberg 8.1.0', 'unregister_block_pattern()' );
return unregister_block_pattern( $pattern_name );
}
21 changes: 0 additions & 21 deletions lib/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,27 +147,6 @@ function gutenberg_add_dom_rect_polyfill( $scripts ) {
}
add_action( 'wp_default_scripts', 'gutenberg_add_dom_rect_polyfill', 20 );

/**
* Sets the current post for usage in template blocks.
*
* @return WP_Post|null The post if any, or null otherwise.
*/
function gutenberg_get_post_from_context() {
// TODO: Without this temporary fix, an infinite loop can occur where
// posts with post content blocks render themselves recursively.
if ( is_admin() || defined( 'REST_REQUEST' ) ) {
return null;
}

_deprecated_function( __FUNCTION__, '8.1.0' );

if ( ! in_the_loop() ) {
rewind_posts();
the_post();
}
return get_post();
}

/**
* Filters default block categories to substitute legacy category names with new
* block categories.
Expand Down