Skip to content

Commit

Permalink
Remove Gutenberg plugin's deprected APIs for version 8.3.0 (#23001)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Jun 9, 2020
1 parent 5f1bf3e commit e0b1d1d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 62 deletions.
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

0 comments on commit e0b1d1d

Please sign in to comment.