Commit 0d8aa03d93 for wordpress.org

commit 0d8aa03d93586683ab604ebc4f7605409c486b70
Author: Weston Ruter <weston@xwp.co>
Date:   Wed Dec 3 19:47:33 2025 +0000

    Block Editor: Move Block Patterns API functions to `block-patterns.php`.

    Follow-up to [48156].

    Props anukasha, dhiraj0901, swissspidy, palak678, madhavishah01.
    See #50445.
    Fixes #64234.

    Built from https://develop.svn.wordpress.org/trunk@61348


    git-svn-id: http://core.svn.wordpress.org/trunk@60660 1a063a9b-81f0-0310-95a4-ce76da25c4cd

diff --git a/wp-includes/block-patterns.php b/wp-includes/block-patterns.php
index 4a2886cdfd..133c6d54ea 100644
--- a/wp-includes/block-patterns.php
+++ b/wp-includes/block-patterns.php
@@ -8,6 +8,59 @@

 add_theme_support( 'core-block-patterns' );

+/**
+ * Registers a new block pattern.
+ *
+ * @since 5.5.0
+ *
+ * @param string $pattern_name       Block pattern name including namespace.
+ * @param array  $pattern_properties List of properties for the block pattern.
+ *                                   See WP_Block_Patterns_Registry::register() for accepted arguments.
+ * @return bool True if the pattern was registered with success and false otherwise.
+ */
+function register_block_pattern( $pattern_name, $pattern_properties ) {
+	return WP_Block_Patterns_Registry::get_instance()->register( $pattern_name, $pattern_properties );
+}
+
+/**
+ * Unregisters a block pattern.
+ *
+ * @since 5.5.0
+ *
+ * @param string $pattern_name Block pattern name including namespace.
+ * @return bool True if the pattern was unregistered with success and false otherwise.
+ */
+function unregister_block_pattern( $pattern_name ) {
+	return WP_Block_Patterns_Registry::get_instance()->unregister( $pattern_name );
+}
+
+/**
+ * Registers a new pattern category.
+ *
+ * @since 5.5.0
+ *
+ * @param string $category_name       Pattern category name including namespace.
+ * @param array  $category_properties List of properties for the block pattern.
+ *                                    See WP_Block_Pattern_Categories_Registry::register() for
+ *                                    accepted arguments.
+ * @return bool True if the pattern category was registered with success and false otherwise.
+ */
+function register_block_pattern_category( $category_name, $category_properties ) {
+	return WP_Block_Pattern_Categories_Registry::get_instance()->register( $category_name, $category_properties );
+}
+
+/**
+ * Unregisters a pattern category.
+ *
+ * @since 5.5.0
+ *
+ * @param string $category_name Pattern category name including namespace.
+ * @return bool True if the pattern category was unregistered with success and false otherwise.
+ */
+function unregister_block_pattern_category( $category_name ) {
+	return WP_Block_Pattern_Categories_Registry::get_instance()->unregister( $category_name );
+}
+
 /**
  * Registers the core block patterns and categories.
  *
diff --git a/wp-includes/class-wp-block-pattern-categories-registry.php b/wp-includes/class-wp-block-pattern-categories-registry.php
index 05ddce8af0..be7cd6d467 100644
--- a/wp-includes/class-wp-block-pattern-categories-registry.php
+++ b/wp-includes/class-wp-block-pattern-categories-registry.php
@@ -162,30 +162,3 @@ final class WP_Block_Pattern_Categories_Registry {
 		return self::$instance;
 	}
 }
-
-/**
- * Registers a new pattern category.
- *
- * @since 5.5.0
- *
- * @param string $category_name       Pattern category name including namespace.
- * @param array  $category_properties List of properties for the block pattern.
- *                                    See WP_Block_Pattern_Categories_Registry::register() for
- *                                    accepted arguments.
- * @return bool True if the pattern category was registered with success and false otherwise.
- */
-function register_block_pattern_category( $category_name, $category_properties ) {
-	return WP_Block_Pattern_Categories_Registry::get_instance()->register( $category_name, $category_properties );
-}
-
-/**
- * Unregisters a pattern category.
- *
- * @since 5.5.0
- *
- * @param string $category_name Pattern category name including namespace.
- * @return bool True if the pattern category was unregistered with success and false otherwise.
- */
-function unregister_block_pattern_category( $category_name ) {
-	return WP_Block_Pattern_Categories_Registry::get_instance()->unregister( $category_name );
-}
diff --git a/wp-includes/class-wp-block-patterns-registry.php b/wp-includes/class-wp-block-patterns-registry.php
index 4667979fc7..fe85160bac 100644
--- a/wp-includes/class-wp-block-patterns-registry.php
+++ b/wp-includes/class-wp-block-patterns-registry.php
@@ -277,29 +277,3 @@ final class WP_Block_Patterns_Registry {
 		return self::$instance;
 	}
 }
-
-/**
- * Registers a new block pattern.
- *
- * @since 5.5.0
- *
- * @param string $pattern_name       Block pattern name including namespace.
- * @param array  $pattern_properties List of properties for the block pattern.
- *                                   See WP_Block_Patterns_Registry::register() for accepted arguments.
- * @return bool True if the pattern was registered with success and false otherwise.
- */
-function register_block_pattern( $pattern_name, $pattern_properties ) {
-	return WP_Block_Patterns_Registry::get_instance()->register( $pattern_name, $pattern_properties );
-}
-
-/**
- * Unregisters a block pattern.
- *
- * @since 5.5.0
- *
- * @param string $pattern_name Block pattern name including namespace.
- * @return bool True if the pattern was unregistered with success and false otherwise.
- */
-function unregister_block_pattern( $pattern_name ) {
-	return WP_Block_Patterns_Registry::get_instance()->unregister( $pattern_name );
-}
diff --git a/wp-includes/version.php b/wp-includes/version.php
index abb93c2c88..13192f7a92 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -16,7 +16,7 @@
  *
  * @global string $wp_version
  */
-$wp_version = '7.0-alpha-61347';
+$wp_version = '7.0-alpha-61348';

 /**
  * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.