diff --git a/lib/compat/wordpress-6.1/block-patterns.php b/lib/compat/wordpress-6.1/block-patterns.php index 7860aa6a1dd66..32a923406d4e9 100644 --- a/lib/compat/wordpress-6.1/block-patterns.php +++ b/lib/compat/wordpress-6.1/block-patterns.php @@ -175,3 +175,48 @@ function gutenberg_register_theme_block_patterns() { } remove_action( 'init', '_register_theme_block_patterns' ); add_action( 'init', 'gutenberg_register_theme_block_patterns' ); + +/** + * Registers Gutenberg-bundled patterns, with a focus on headers and footers + * for site editing. + * + * @since 6.1.0 + * @access private + */ +function gutenberg_register_core_block_patterns() { + $should_register_core_patterns = get_theme_support( 'core-block-patterns' ); + + if ( $should_register_core_patterns ) { + $core_block_patterns = array( + 'centered-footer', + 'centered-footer-with-social-links', + 'centered-header', + 'centered-logo-in-navigation', + 'footer-with-background-color-and-three-columns', + 'footer-with-credit-line-and-navigation', + 'footer-with-large-font-size', + 'footer-with-navigation-and-credit-line', + 'footer-with-search-site-title-and-credit-line', + 'footer-with-site-title-and-credit-line', + 'header-with-large-font-size', + 'left-aligned-footer', + 'right-aligned-footer', + 'simple-header', + 'simple-header-inside-image', + 'simple-header-with-background-color', + 'simple-header-with-image', + 'simple-header-with-tagline', + 'simple-header-with-tagline-2', + 'site-title-and-menu-button', + 'site-title-and-vertical-navigation', + ); + + foreach ( $core_block_patterns as $core_block_pattern ) { + register_block_pattern( + 'core/' . $core_block_pattern, + require __DIR__ . '/block-patterns/' . $core_block_pattern . '.php' + ); + } + } +} +add_action( 'init', 'gutenberg_register_core_block_patterns' ); diff --git a/lib/compat/wordpress-6.1/block-patterns/centered-footer-with-social-links.php b/lib/compat/wordpress-6.1/block-patterns/centered-footer-with-social-links.php new file mode 100644 index 0000000000000..ceb7e6b5dccd8 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/centered-footer-with-social-links.php @@ -0,0 +1,41 @@ + _x( 'Centered footer with social links', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/footer' ), + 'categories' => array( 'footer' ), + 'content' => ' +
+ + + + + + + + + + + + + + + + +

' + . sprintf( + /* translators: %s: WordPress */ + __( 'Proudly powered by %s', 'gutenberg' ), + 'WordPress' + ) . + '

+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/centered-footer.php b/lib/compat/wordpress-6.1/block-patterns/centered-footer.php new file mode 100644 index 0000000000000..a341cdf0442d0 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/centered-footer.php @@ -0,0 +1,25 @@ + _x( 'Centered footer', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/footer' ), + 'categories' => array( 'footer' ), + 'content' => ' +
+
+

' + . sprintf( + /* translators: %s: WordPress */ + __( 'Proudly powered by %s', 'gutenberg' ), + 'WordPress' + ) . + '

+
+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/centered-header.php b/lib/compat/wordpress-6.1/block-patterns/centered-header.php new file mode 100644 index 0000000000000..a72de34bf5b10 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/centered-header.php @@ -0,0 +1,19 @@ + _x( 'Centered header', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/header' ), + 'categories' => array( 'header' ), + 'content' => ' +
+ + + +
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/centered-logo-in-navigation.php b/lib/compat/wordpress-6.1/block-patterns/centered-logo-in-navigation.php new file mode 100644 index 0000000000000..856fca10ffbe6 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/centered-logo-in-navigation.php @@ -0,0 +1,25 @@ + _x( 'Centered logo in navigation', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/header' ), + 'categories' => array( 'header' ), + 'content' => ' +
+ + + + + + + + + +
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/footer-with-background-color-and-three-columns.php b/lib/compat/wordpress-6.1/block-patterns/footer-with-background-color-and-three-columns.php new file mode 100644 index 0000000000000..c4e2c2924d95f --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/footer-with-background-color-and-three-columns.php @@ -0,0 +1,53 @@ + _x( 'Footer with background color and three columns', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/footer' ), + 'categories' => array( 'footer' ), + 'content' => ' + + ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/footer-with-credit-line-and-navigation.php b/lib/compat/wordpress-6.1/block-patterns/footer-with-credit-line-and-navigation.php new file mode 100644 index 0000000000000..e7ef17af12ec0 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/footer-with-credit-line-and-navigation.php @@ -0,0 +1,28 @@ + _x( 'Footer with credit line and navigation', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/footer' ), + 'categories' => array( 'footer' ), + 'content' => ' +
+
+

' + . sprintf( + /* translators: %s: WordPress */ + __( 'Proudly powered by %s', 'gutenberg' ), + 'WordPress' + ) . + '

+ + + +
+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/footer-with-large-font-size.php b/lib/compat/wordpress-6.1/block-patterns/footer-with-large-font-size.php new file mode 100644 index 0000000000000..0bd3e0f6f2be6 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/footer-with-large-font-size.php @@ -0,0 +1,25 @@ + _x( 'Footer with Large Font Size', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/footer' ), + 'categories' => array( 'footer' ), + 'content' => ' +
+ + +

' + . sprintf( + /* translators: %s: WordPress */ + __( 'Proudly powered by %s', 'gutenberg' ), + 'WordPress' + ) . + '

+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/footer-with-navigation-and-credit-line.php b/lib/compat/wordpress-6.1/block-patterns/footer-with-navigation-and-credit-line.php new file mode 100644 index 0000000000000..7b7d83675b0b7 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/footer-with-navigation-and-credit-line.php @@ -0,0 +1,27 @@ + _x( 'Footer with navigation and credit line', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/footer' ), + 'categories' => array( 'footer' ), + 'content' => ' +
+
+ + +

' + . sprintf( + /* translators: %s: WordPress */ + __( 'Proudly powered by %s', 'gutenberg' ), + 'WordPress' + ) . + '

+
+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/footer-with-search-site-title-and-credit-line.php b/lib/compat/wordpress-6.1/block-patterns/footer-with-search-site-title-and-credit-line.php new file mode 100644 index 0000000000000..fc44d40cdcf0c --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/footer-with-search-site-title-and-credit-line.php @@ -0,0 +1,47 @@ + _x( 'Footer with search, site title, and credit line', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/footer' ), + 'categories' => array( 'footer' ), + 'content' => ' +
+
+
+
+
+ + + +
+
+ + + + + + + +
+
+ + + +
+

' + . sprintf( + /* translators: %s: WordPress */ + __( 'Proudly powered by %s', 'gutenberg' ), + 'WordPress' + ) . + '

+
+
+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/footer-with-site-title-and-credit-line.php b/lib/compat/wordpress-6.1/block-patterns/footer-with-site-title-and-credit-line.php new file mode 100644 index 0000000000000..c7d9d8e8736bc --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/footer-with-site-title-and-credit-line.php @@ -0,0 +1,27 @@ + _x( 'Footer with site title and credit line', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/footer' ), + 'categories' => array( 'footer' ), + 'content' => ' +
+
+ + +

' + . sprintf( + /* translators: %s: WordPress */ + __( 'Proudly powered by %s', 'gutenberg' ), + 'WordPress' + ) . + '

+
+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/header-with-large-font-size.php b/lib/compat/wordpress-6.1/block-patterns/header-with-large-font-size.php new file mode 100644 index 0000000000000..2a34032575f83 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/header-with-large-font-size.php @@ -0,0 +1,17 @@ + _x( 'Header with Large Font Size', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/header' ), + 'categories' => array( 'header' ), + 'content' => ' +
+ +
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/left-aligned-footer.php b/lib/compat/wordpress-6.1/block-patterns/left-aligned-footer.php new file mode 100644 index 0000000000000..adb8ab3974dfa --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/left-aligned-footer.php @@ -0,0 +1,23 @@ + _x( 'Left-aligned footer', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/footer' ), + 'categories' => array( 'footer' ), + 'content' => ' +
+

' + . sprintf( + /* translators: %s: WordPress */ + __( 'Proudly powered by %s', 'gutenberg' ), + 'WordPress' + ) . + '

+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/right-aligned-footer.php b/lib/compat/wordpress-6.1/block-patterns/right-aligned-footer.php new file mode 100644 index 0000000000000..2e7693cc3a242 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/right-aligned-footer.php @@ -0,0 +1,23 @@ + _x( 'Right-aligned footer', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/footer' ), + 'categories' => array( 'footer' ), + 'content' => ' +
+

' + . sprintf( + /* translators: %s: WordPress */ + __( 'Proudly powered by %s', 'gutenberg' ), + 'WordPress' + ) . + '

+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/simple-header-inside-image.php b/lib/compat/wordpress-6.1/block-patterns/simple-header-inside-image.php new file mode 100644 index 0000000000000..7a9edac03dbf0 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/simple-header-inside-image.php @@ -0,0 +1,34 @@ + _x( 'Simple header inside image', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/header' ), + 'categories' => array( 'header' ), + 'content' => ' +
+
+
+
+
+ +
+
+ + + +
+
+
+ + + + +
+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/simple-header-with-background-color.php b/lib/compat/wordpress-6.1/block-patterns/simple-header-with-background-color.php new file mode 100644 index 0000000000000..2d003ab63d878 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/simple-header-with-background-color.php @@ -0,0 +1,23 @@ + _x( 'Simple header with background color', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/header' ), + 'categories' => array( 'header' ), + 'content' => ' +
+
+
+ +
+ + +
+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/simple-header-with-image.php b/lib/compat/wordpress-6.1/block-patterns/simple-header-with-image.php new file mode 100644 index 0000000000000..043cead1552b3 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/simple-header-with-image.php @@ -0,0 +1,29 @@ + _x( 'Simple header with image', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/header' ), + 'categories' => array( 'header' ), + 'content' => ' +
+
+
+ +
+ + +
+ + + +
+

+
+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/simple-header-with-tagline-2.php b/lib/compat/wordpress-6.1/block-patterns/simple-header-with-tagline-2.php new file mode 100644 index 0000000000000..8995de8436389 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/simple-header-with-tagline-2.php @@ -0,0 +1,27 @@ + _x( 'Simple header with tagline', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/header' ), + 'categories' => array( 'header' ), + 'content' => ' +
+
+
+ + +
+ +
+
+ + +
+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/simple-header-with-tagline.php b/lib/compat/wordpress-6.1/block-patterns/simple-header-with-tagline.php new file mode 100644 index 0000000000000..9047e85112747 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/simple-header-with-tagline.php @@ -0,0 +1,23 @@ + _x( 'Text-only header with tagline', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/header' ), + 'categories' => array( 'header' ), + 'content' => ' +
+
+
+ +
+ + +
+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/simple-header.php b/lib/compat/wordpress-6.1/block-patterns/simple-header.php new file mode 100644 index 0000000000000..2ceeeb3c71865 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/simple-header.php @@ -0,0 +1,23 @@ + _x( 'Simple header', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/header' ), + 'categories' => array( 'header' ), + 'content' => ' +
+
+
+ +
+ + +
+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/site-title-and-menu-button.php b/lib/compat/wordpress-6.1/block-patterns/site-title-and-menu-button.php new file mode 100644 index 0000000000000..d9c44a4e5bb78 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/site-title-and-menu-button.php @@ -0,0 +1,21 @@ + _x( 'Site title and menu button', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/header' ), + 'categories' => array( 'header' ), + 'content' => ' +
+
+
+ + +
+
+ ', +); diff --git a/lib/compat/wordpress-6.1/block-patterns/site-title-and-vertical-navigation.php b/lib/compat/wordpress-6.1/block-patterns/site-title-and-vertical-navigation.php new file mode 100644 index 0000000000000..8b78e96185b36 --- /dev/null +++ b/lib/compat/wordpress-6.1/block-patterns/site-title-and-vertical-navigation.php @@ -0,0 +1,28 @@ + _x( 'Site title and vertical navigation', 'Block pattern title', 'gutenberg' ), + 'blockTypes' => array( 'core/template-part/header' ), + 'categories' => array( 'header' ), + 'content' => ' +
+
+
+
+
+ + + +
+
+
+
+
+
+ ', +);