Skip to content

Commit

Permalink
prep build 10/10
Browse files Browse the repository at this point in the history
  • Loading branch information
bph committed Oct 10, 2024
2 parents 2d813fc + 017c8bc commit 06b8f69
Show file tree
Hide file tree
Showing 113 changed files with 2,217 additions and 680 deletions.
3 changes: 3 additions & 0 deletions backport-changelog/6.7/7543.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
https://github.com/WordPress/wordpress-develop/pull/7543

* https://github.com/WordPress/gutenberg/pull/65958
6 changes: 3 additions & 3 deletions docs/how-to-guides/data-basics/1-data-basics-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ We'll do all the development inside of a WordPress plugin. Let's start by creati

- my-first-gutenberg-app.php – to create a new admin page
- src/index.js – for our JavaScript application
- style.css – for the minimal stylesheet
- src/style.css – for the minimal stylesheet
- package.json – for the build process

Go ahead and create these files using the following snippets:
Expand All @@ -36,7 +36,7 @@ window.addEventListener(
);
```

**style.css:**
**src/style.css:**

```css
.toplevel_page_my-first-gutenberg-app #wpcontent {
Expand Down Expand Up @@ -149,7 +149,7 @@ function load_custom_wp_admin_scripts( $hook ) {
// Load our style.css.
wp_register_style(
'my-first-gutenberg-app',
plugins_url( 'style.css', __FILE__ ),
plugins_url( 'build/style-index.css', __FILE__ ),
array(),
$asset_file['version']
);
Expand Down
49 changes: 46 additions & 3 deletions lib/compat/wordpress-6.7/block-templates.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @package gutenberg
*/

if ( ! function_exists( 'wp_register_block_template' ) ) {
if ( ! function_exists( 'register_block_template' ) ) {
/**
* Register a template.
*
Expand All @@ -22,20 +22,63 @@
* }
* @return WP_Block_Template|WP_Error The registered template object on success, WP_Error object on failure.
*/
function wp_register_block_template( $template_name, $args = array() ) {
function register_block_template( $template_name, $args = array() ) {
return WP_Block_Templates_Registry::get_instance()->register( $template_name, $args );
}
}

if ( ! function_exists( 'unregister_block_template' ) ) {
/**
* Unregister a template.
*
* @param string $template_name Template name in the form of `plugin_uri//template_name`.
* @return WP_Block_Template|WP_Error The unregistered template object on success, WP_Error object on failure or if
* the template doesn't exist.
*/
function unregister_block_template( $template_name ) {
return WP_Block_Templates_Registry::get_instance()->unregister( $template_name );
}
}

if ( ! function_exists( 'wp_register_block_template' ) ) {
/**
* Register a template.
*
* @deprecated 19.4.0 wp_register_block_template is deprecated. Please use register_block_template instead.
*
* @param string $template_name Template name in the form of `plugin_uri//template_name`.
* @param array|string $args {
* Optional. Array or string of arguments for registering a block template.
*
* @type string $title Optional. Title of the template as it will be shown in the Site Editor
* and other UI elements.
* @type string $description Optional. Description of the template as it will be shown in the Site
* Editor.
* @type string $content Optional. Default content of the template that will be used when the
* template is rendered or edited in the editor.
* @type string[] $post_types Optional. Array of post types to which the template should be available.
* @type string $plugin Uri of the plugin that registers the template.
* }
* @return WP_Block_Template|WP_Error The registered template object on success, WP_Error object on failure.
*/
function wp_register_block_template( $template_name, $args = array() ) {
_deprecated_function( __FUNCTION__, 'Gutenberg 19.4.0', 'register_block_template' );
register_block_template( $template_name, $args );
}
}

if ( ! function_exists( 'wp_unregister_block_template' ) ) {
/**
* Unregister a template.
*
* @deprecated 19.4.0 wp_unregister_block_template is deprecated. Please use unregister_block_template instead.
*
* @param string $template_name Template name in the form of `plugin_uri//template_name`.
* @return WP_Block_Template|WP_Error The unregistered template object on success, WP_Error object on failure or if
* the template doesn't exist.
*/
function wp_unregister_block_template( $template_name ) {
return WP_Block_Templates_Registry::get_instance()->unregister( $template_name );
_deprecated_function( __FUNCTION__, 'Gutenberg 19.4.0', 'unregister_block_template' );
return unregister_block_template( $template_name );
}
}
Loading

0 comments on commit 06b8f69

Please sign in to comment.