Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Sync with WP trunk #223

Merged
merged 2 commits into from
Nov 10, 2021
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
2 changes: 1 addition & 1 deletion block-template-parts/footer.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!-- wp:pattern {"slug":"twentytwentytwo/footer-default"} /-->
<!-- wp:pattern {"slug":"twentytwentytwo/footer-default"} /-->
2 changes: 1 addition & 1 deletion block-template-parts/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true} -->
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /-->
<!-- /wp:navigation --></div>
<!-- /wp:group -->
<!-- /wp:group -->
2 changes: 1 addition & 1 deletion block-templates/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
<!-- /wp:group --></main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
2 changes: 1 addition & 1 deletion block-templates/blank.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!-- wp:post-content {"layout":{"inherit":true}} /-->
<!-- wp:post-content {"layout":{"inherit":true}} /-->
2 changes: 1 addition & 1 deletion block-templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
<!-- /wp:query --></div>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
2 changes: 1 addition & 1 deletion block-templates/page-home.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
</main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
2 changes: 1 addition & 1 deletion block-templates/page-no-separators.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
<!-- /wp:group --></main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
2 changes: 1 addition & 1 deletion block-templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
<!-- /wp:group --></main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
2 changes: 1 addition & 1 deletion block-templates/single-no-separators.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@
<!-- /wp:group --></main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
2 changes: 1 addition & 1 deletion block-templates/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
<!-- /wp:group --></main>
<!-- /wp:group -->

<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
<!-- wp:template-part {"slug":"footer","tagName":"footer","style":{"spacing":{"padding":{"top":"var(--wp--custom--spacing--large, 8rem)","right":"var(--wp--custom--spacing--small, 1.25rem)","left":"var(--wp--custom--spacing--small, 1.25rem)"}}},"layout":{"inherit":true}} /-->
21 changes: 15 additions & 6 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @package WordPress
* @subpackage Twenty_Twenty_Two
* @since 1.0.0
* @since Twenty Twenty-Two 1.0
*/


Expand All @@ -15,6 +15,8 @@
/**
* Sets up theme defaults and registers support for various WordPress features.
*
* @since Twenty Twenty-Two 1.0
*
* @return void
*/
function twentytwentytwo_support() {
Expand All @@ -24,17 +26,20 @@ function twentytwentytwo_support() {

// Enqueue editor styles.
add_editor_style( get_template_directory_uri() . '/style.css' );

}
add_action( 'after_setup_theme', 'twentytwentytwo_support' );

endif;

add_action( 'after_setup_theme', 'twentytwentytwo_support' );

if ( ! function_exists( 'twentytwentytwo_styles' ) ) :

/**
* Enqueue styles.
*
* @since Twenty Twenty-Two 1.0
*
* @return void
*/
function twentytwentytwo_styles() {
Expand All @@ -44,7 +49,7 @@ function twentytwentytwo_styles() {
'twentytwentytwo-style',
get_template_directory_uri() . '/style.css',
array(),
wp_get_theme()->get( 'Version' ),
wp_get_theme()->get( 'Version' )
);

// Add styles inline.
Expand All @@ -54,16 +59,18 @@ function twentytwentytwo_styles() {
wp_enqueue_style( 'twentytwentytwo-style' );

}
add_action( 'wp_enqueue_scripts', 'twentytwentytwo_styles' );

endif;

add_action( 'wp_enqueue_scripts', 'twentytwentytwo_styles' );

if ( ! function_exists( 'twentytwentytwo_editor_styles' ) ) :

/**
* Enqueue editor styles.
*
* @since Twenty Twenty-Two 1.0
*
* @return void
*/
function twentytwentytwo_editor_styles() {
Expand All @@ -72,17 +79,20 @@ function twentytwentytwo_editor_styles() {
wp_add_inline_style( 'wp-block-library', twentytwentytwo_get_font_face_styles() );

}
add_action( 'admin_init', 'twentytwentytwo_editor_styles' );

endif;

add_action( 'admin_init', 'twentytwentytwo_editor_styles' );


if ( ! function_exists( 'twentytwentytwo_get_font_face_styles' ) ) :

/**
* Get font face styles.
* Called by functions twentytwentytwo_styles() and twentytwentytwo_editor_styles() above.
*
* @since Twenty Twenty-Two 1.0
*
* @return string
*/
function twentytwentytwo_get_font_face_styles() {
Expand All @@ -109,6 +119,5 @@ function twentytwentytwo_get_font_face_styles() {

endif;


// Add block patterns
require get_template_directory() . '/inc/block-patterns.php';
197 changes: 100 additions & 97 deletions inc/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,108 +2,111 @@
/**
* Twenty Twenty-Two: Block Patterns
*
* @since 1.0
* @since Twenty Twenty-Two 1.0
*/

if ( ! function_exists( 'twentytwentytwo_register_block_patterns' ) ) :
/**
* Registers block patterns and categories.
*
* @since Twenty Twenty-Two 1.0
*/
function twentytwentytwo_register_block_patterns() {
if ( function_exists( 'register_block_pattern_category' ) ) {
register_block_pattern_category(
'twentytwentytwo-general',
array( 'label' => __( 'Twenty Twenty-Two General', 'twentytwentytwo' ) )
);
register_block_pattern_category(
'twentytwentytwo-footers',
array( 'label' => __( 'Twenty Twenty-Two Footers', 'twentytwentytwo' ) )
);
register_block_pattern_category(
'twentytwentytwo-headers',
array( 'label' => __( 'Twenty Twenty-Two Headers', 'twentytwentytwo' ) )
);
register_block_pattern_category(
'twentytwentytwo-query',
array( 'label' => __( 'Twenty Twenty-Two Posts', 'twentytwentytwo' ) )
);
register_block_pattern_category(
'twentytwentytwo-pages',
array( 'label' => __( 'Twenty Twenty-Two Pages', 'twentytwentytwo' ) )
);
}
if ( function_exists( 'register_block_pattern' ) ) {
$block_patterns = array(
'footer-default',
'footer-dark',
'footer-logo',
'footer-navigation',
'footer-title-tagline-social',
'footer-title-tagline-social-dark',
'footer-social-copyright',
'footer-navigation-copyright',
'footer-about-title-logo',
'footer-query-title-citation',
'footer-query-images-title-citation',
'footer-blog',
'general-subscribe',
'general-featured-posts',
'general-layered-images-with-duotone',
'general-wide-image-intro-buttons',
'general-large-list-names',
'general-video-header-details',
'general-list-events',
'general-two-images-text',
'general-image-with-caption',
'general-video-trailer',
'general-pricing-table',
'general-divider-light',
'general-divider-dark',
'header-default',
'header-large-dark',
'header-image-background',
'header-image-background-overlay',
'header-with-tagline',
'header-text-only-green-background',
'header-text-only-salmon-background',
'header-title-and-button',
'header-text-only-with-tagline-black-background',
'header-logo-navigation-gray-background',
'header-logo-navigation-social-black-background',
'header-title-navigation-social',
'header-logo-navigation-offset-tagline',
'header-stacked',
'header-centered-logo',
'header-centered-logo-black-background',
'header-centered-title-navigation-social',
'header-title-and-button',
'hidden-404',
'hidden-heading-and-bird',
'page-about-big-image-and-buttons',
'page-about-media-left',
'page-about-simple-dark',
'page-about-media-right',
'page-about-links',
'page-about-links-dark',
'page-layout-image-and-text',
'page-layout-image-text-and-video',
'page-layout-two-columns',
'page-sidebar-poster',
'page-sidebar-grid-posts',
'page-sidebar-blog-posts',
'page-sidebar-blog-posts-right',
'query-default',
'query-simple-blog',
'query-grid',
'query-text-grid',
'query-image-grid',
'query-large-titles',
'query-irregular-grid',
);

foreach ( $block_patterns as $block_pattern ) {
register_block_pattern(
'twentytwentytwo/' . $block_pattern,
require __DIR__ . '/patterns/' . $block_pattern . '.php'
);
}
register_block_pattern_category(
'twentytwentytwo-general',
array( 'label' => __( 'Twenty Twenty-Two General', 'twentytwentytwo' ) )
);
register_block_pattern_category(
'twentytwentytwo-footers',
array( 'label' => __( 'Twenty Twenty-Two Footers', 'twentytwentytwo' ) )
);
register_block_pattern_category(
'twentytwentytwo-headers',
array( 'label' => __( 'Twenty Twenty-Two Headers', 'twentytwentytwo' ) )
);
register_block_pattern_category(
'twentytwentytwo-query',
array( 'label' => __( 'Twenty Twenty-Two Posts', 'twentytwentytwo' ) )
);
register_block_pattern_category(
'twentytwentytwo-pages',
array( 'label' => __( 'Twenty Twenty-Two Pages', 'twentytwentytwo' ) )
);

$block_patterns = array(
'footer-default',
'footer-dark',
'footer-logo',
'footer-navigation',
'footer-title-tagline-social',
'footer-title-tagline-social-dark',
'footer-social-copyright',
'footer-navigation-copyright',
'footer-about-title-logo',
'footer-query-title-citation',
'footer-query-images-title-citation',
'footer-blog',
'general-subscribe',
'general-featured-posts',
'general-layered-images-with-duotone',
'general-wide-image-intro-buttons',
'general-large-list-names',
'general-video-header-details',
'general-list-events',
'general-two-images-text',
'general-image-with-caption',
'general-video-trailer',
'general-pricing-table',
'general-divider-light',
'general-divider-dark',
'header-default',
'header-large-dark',
'header-image-background',
'header-image-background-overlay',
'header-with-tagline',
'header-text-only-green-background',
'header-text-only-salmon-background',
'header-title-and-button',
'header-text-only-with-tagline-black-background',
'header-logo-navigation-gray-background',
'header-logo-navigation-social-black-background',
'header-title-navigation-social',
'header-logo-navigation-offset-tagline',
'header-stacked',
'header-centered-logo',
'header-centered-logo-black-background',
'header-centered-title-navigation-social',
'header-title-and-button',
'hidden-404',
'hidden-heading-and-bird',
'page-about-big-image-and-buttons',
'page-about-media-left',
'page-about-simple-dark',
'page-about-media-right',
'page-about-links',
'page-about-links-dark',
'page-layout-image-and-text',
'page-layout-image-text-and-video',
'page-layout-two-columns',
'page-sidebar-poster',
'page-sidebar-grid-posts',
'page-sidebar-blog-posts',
'page-sidebar-blog-posts-right',
'query-default',
'query-simple-blog',
'query-grid',
'query-text-grid',
'query-image-grid',
'query-large-titles',
'query-irregular-grid',
);

foreach ( $block_patterns as $block_pattern ) {
register_block_pattern(
'twentytwentytwo/' . $block_pattern,
require __DIR__ . '/patterns/' . $block_pattern . '.php'
);
}
}
endif;
Expand Down
4 changes: 2 additions & 2 deletions inc/patterns/footer-about-title-logo.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
'content' => '<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"8rem","bottom":"6rem"}}},"backgroundColor":"secondary","layout":{"inherit":true}} -->
<div class="wp-block-group alignfull has-secondary-background-color has-background" style="padding-top:8rem;padding-bottom:6rem"><!-- wp:columns {"align":"wide"} -->
<div class="wp-block-columns alignwide"><!-- wp:column {"width":"33%"} -->
<div class="wp-block-column" style="flex-basis:33%"><!-- wp:paragraph -->
<p>' . esc_html__( 'ABOUT US', 'twentytwentytwo' ) . '</p>
<div class="wp-block-column" style="flex-basis:33%"><!-- wp:paragraph {"style":{"typography":{"textTransform":"uppercase"}}} -->
<p style="text-transform:uppercase">' . esc_html__( 'About us', 'twentytwentytwo' ) . '</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph {"style":{"fontSize":"small"} -->
Expand Down
Loading