This repository has been archived by the owner on Jan 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Add header block patterns #74
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9de6fd9
Add header block patterns
kjellr f69b1fc
Remove empty paragraph block.
kjellr 7ccc96d
Register title nav social pattern.
kjellr dee270b
Add text-only header with stacked tagline.
kjellr e958956
Fix pattern slug.
kjellr 6963f75
Reorder patterns, add missing comma.
kjellr 65da3c1
Use preset color variables for the social links block.
kjellr b047708
Tidy up margin for stacked title/tagline patterns.
kjellr bcbdc32
Add additional patterns.
kjellr f2c40d6
Merge branch 'trunk' into add/header-block-patterns
kjellr 09965f5
Merge branch 'trunk' into add/header-block-patterns
kjellr b63766f
Fix PHPCS errors.
kjellr 7bd25ea
Merge branch 'add/header-block-patterns' of https://github.com/WordPr…
kjellr 060b0fa
Fix PHPCS errors.
kjellr d32c73a
Update all patterns to use a header tagName.
kjellr ec40e46
Use links instead of two page lists.
kjellr 473937b
Remove tagNames to avoid duplication.
kjellr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* Twenty Twenty-Two: Block Patterns | ||
* | ||
* @since 1.0 | ||
*/ | ||
|
||
if ( ! function_exists( 'twentytwentytwo_register_block_patterns' ) ) : | ||
function twentytwentytwo_register_block_patterns() { | ||
if ( function_exists( 'register_block_pattern_category' ) ) { | ||
register_block_pattern_category( | ||
'twentytwentytwo-headers', | ||
array( 'label' => __( 'Twenty Twenty-Two Headers', 'twentytwentytwo' ) ) | ||
); | ||
} | ||
if ( function_exists( 'register_block_pattern' ) ) { | ||
$block_patterns = array( | ||
'header-default', | ||
'header-with-tagline', | ||
'header-text-only-with-stacked-tagline', | ||
'header-text-only', | ||
'header-text-only-with-tagline', | ||
'header-text-only-all-caps-with-tagline', | ||
'header-logo-navigation', | ||
'header-logo-navigation-social', | ||
'header-title-navigation-social', | ||
'header-logo-navigation-offset-tagline', | ||
'header-stacked', | ||
'header-large-dark', | ||
'header-centered-logo', | ||
'header-centered-logo-in-navigation', | ||
'header-centered-title-navigation-social', | ||
'header-title-and-button', | ||
); | ||
|
||
foreach ( $block_patterns as $block_pattern ) { | ||
register_block_pattern( | ||
'twentytwentytwo/' . $block_pattern, | ||
require __DIR__ . '/patterns/' . $block_pattern . '.php' | ||
); | ||
} | ||
} | ||
} | ||
endif; | ||
add_action( 'init', 'twentytwentytwo_register_block_patterns', 9 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* Header with centered Logo in Navigation block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Header with centered Logo in Navigation', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"center"}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> | ||
<!-- wp:navigation-link {"isTopLevelLink":true} /--> | ||
|
||
<!-- wp:navigation-link {"isTopLevelLink":true} /--> | ||
|
||
<!-- wp:site-logo {"width":90} /--> | ||
|
||
<!-- wp:navigation-link {"isTopLevelLink":true} /--> | ||
|
||
<!-- wp:navigation-link {"isTopLevelLink":true} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
/** | ||
* Header with centered Logo block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Header with centered Logo', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:columns {"verticalAlignment":"center"} --> | ||
<div class="wp-block-columns are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center"} --> | ||
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:site-title {"style":{"typography":{"fontStyle":"normal","fontWeight":"400","textTransform":"uppercase"}}} /--></div> | ||
<!-- /wp:column --> | ||
|
||
<!-- wp:column {"width":"64px"} --> | ||
<div class="wp-block-column" style="flex-basis:64px"><!-- wp:site-logo {"width":64} /--></div> | ||
<!-- /wp:column --> | ||
|
||
<!-- wp:column {"verticalAlignment":"center"} --> | ||
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:column --></div> | ||
<!-- /wp:columns --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
/** | ||
* Centered title with Navigation and Social Links Header block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Centered title with Navigation and Social Links Header', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:columns {"verticalAlignment":"center"} --> | ||
<div class="wp-block-columns are-vertically-aligned-center"><!-- wp:column {"verticalAlignment":"center"} --> | ||
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:navigation {"itemsJustification":"left","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:column --> | ||
|
||
<!-- wp:column {"width":""} --> | ||
<div class="wp-block-column"><!-- wp:site-title {"textAlign":"center","style":{"typography":{"textTransform":"uppercase","fontStyle":"normal","fontWeight":"700"}}} /--></div> | ||
<!-- /wp:column --> | ||
|
||
<!-- wp:column {"verticalAlignment":"center"} --> | ||
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:social-links {"iconColor":"foreground","iconColorValue":"var(--wp--preset--color--foreground)","className":"is-style-logos-only","layout":{"type":"flex","justifyContent":"right"}} --> | ||
<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"twitter"} /--> | ||
|
||
<!-- wp:social-link {"url":"#","service":"instagram"} /--></ul> | ||
<!-- /wp:social-links --></div> | ||
<!-- /wp:column --></div> | ||
<!-- /wp:columns --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
/** | ||
* Default Header block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Default Header', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:group {"layout":{"type":"flex"}} --> | ||
<div class="wp-block-group"> | ||
<!-- wp:site-logo {"width":64} /--> | ||
|
||
<!-- wp:site-title {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /--></div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
/** | ||
* Large Header block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Large Header', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"style":{"elements":{"link":{"color":{"text":"var:preset|color|background"}}},"spacing":{"padding":{"top":"0px","right":"max(1.25rem, 5vw)","bottom":"max(1.25rem, 5vw)","left":"max(1.25rem, 5vw)"}}},"backgroundColor":"foreground","textColor":"background","layout":{"inherit":true}} --> | ||
<div class="wp-block-group has-background-color has-foreground-background-color has-text-color has-background has-link-color" style="padding-top:0px;padding-right:max(1.25rem, 5vw);padding-bottom:max(1.25rem, 5vw);padding-left:max(1.25rem, 5vw)"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:group {"layout":{"type":"flex"}} --> | ||
<div class="wp-block-group"> | ||
<!-- wp:site-logo {"width":64} /--> | ||
|
||
<!-- wp:site-title {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /--></div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:columns {"align":"wide"} --> | ||
<div class="wp-block-columns alignwide"><!-- wp:column --> | ||
<div class="wp-block-column"><!-- wp:site-tagline {"style":{"typography":{"fontFamily":"var:preset|font-family|source-serif-pro","fontWeight":"300","fontSize":"clamp(4rem, 8vw, 6.25rem)","lineHeight":"1.15"}}} /--></div> | ||
<!-- /wp:column --></div> | ||
<!-- /wp:columns --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
/** | ||
* Logo, Navigation, and offset Tagline Header block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Logo, Navigation, and offset Tagline Header', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem"}}}} --> | ||
<div class="wp-block-group alignwide" style="padding-bottom:8rem"><!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw)"><!-- wp:site-logo {"width":64} /--> | ||
|
||
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:columns {"isStackedOnMobile":false,"align":"wide"} --> | ||
<div class="wp-block-columns alignwide is-not-stacked-on-mobile"><!-- wp:column {"width":"64px"} --> | ||
<div class="wp-block-column" style="flex-basis:64px"></div> | ||
<!-- /wp:column --> | ||
|
||
<!-- wp:column {"width":"380px"} --> | ||
<div class="wp-block-column" style="flex-basis:380px"><!-- wp:site-tagline {"fontSize":"small"} /--></div> | ||
<!-- /wp:column --></div> | ||
<!-- /wp:columns --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
/** | ||
* Logo, Navigation, and Social Links Header block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Logo, Navigation, and Social Links Header', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:site-logo {"width":64} /--> | ||
|
||
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
|
||
<!-- wp:social-links {"iconColor":"foreground","iconColorValue":"var(--wp--preset--color--foreground)","className":"is-style-logos-only"} --> | ||
<ul class="wp-block-social-links has-icon-color is-style-logos-only"><!-- wp:social-link {"url":"#","service":"instagram"} /--> | ||
|
||
<!-- wp:social-link {"url":"#","service":"twitter"} /--></ul> | ||
<!-- /wp:social-links --> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/** | ||
* Logo and Navigation Header | ||
*/ | ||
return array( | ||
'title' => __( 'Logo and Navigation Header', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:site-logo {"width":64} /--> | ||
|
||
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
/** | ||
* Logo and Navigation Header block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Logo and Navigation Header', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:site-logo {"align":"center","width":128} /--> | ||
|
||
<!-- wp:spacer {"height":10} --> | ||
<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div> | ||
<!-- /wp:spacer --> | ||
|
||
<!-- wp:site-title {"textAlign":"center","style":{"typography":{"fontStyle":"normal","fontWeight":"400","textTransform":"uppercase"}}} /--> | ||
|
||
<!-- wp:spacer {"height":10} --> | ||
<div style="height:10px" aria-hidden="true" class="wp-block-spacer"></div> | ||
<!-- /wp:spacer --> | ||
|
||
<!-- wp:navigation {"itemsJustification":"center","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* Text-only Header with Tagline and all-caps Title block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Text-only Header with Tagline and all-caps Title', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:group {"layout":{"type":"flex","justifyContent":"left"}} --> | ||
<div class="wp-block-group"><!-- wp:site-title {"style":{"typography":{"textTransform":"uppercase"}}} /--> | ||
|
||
<!-- wp:site-tagline {"fontSize":"small","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /--></div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* Text-only Header with stacked Tagline block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Text-only Header with stacked Tagline', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:group --> | ||
<div class="wp-block-group"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontStyle":"normal","fontWeight":"700"}}} /--> | ||
|
||
<!-- wp:site-tagline {"style":{"spacing":{"margin":{"top":"0.25em","bottom":"0px"}},"typography":{"fontStyle":"italic","fontWeight":"400"}},"fontSize":"small"} /--></div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
/** | ||
* Text-only Header with Tagline block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Text-only Header with Tagline', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:group {"layout":{"type":"flex","justifyContent":"left"}} --> | ||
<div class="wp-block-group"><!-- wp:site-title {"style":{"typography":{"fontStyle":"normal","fontWeight":"700"}}} /--> | ||
|
||
<!-- wp:site-tagline {"fontSize":"small","style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /--></div> | ||
<!-- /wp:group --> | ||
|
||
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/** | ||
* Text-only Header block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Text-only Header', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:site-title {"style":{"typography":{"fontStyle":"italic","fontWeight":"400"}}} /--> | ||
|
||
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:group -->', | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/** | ||
* Title and Button Header block pattern | ||
*/ | ||
return array( | ||
'title' => __( 'Title and Button Header', 'twentytwentytwo' ), | ||
'categories' => array( 'twentytwentytwo-headers' ), | ||
'blockTypes' => array( 'core/template-part/header' ), | ||
'content' => '<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"bottom":"8rem","top":"max(1.25rem, 5vw)"}}},"layout":{"type":"flex","justifyContent":"space-between"}} --> | ||
<div class="wp-block-group alignwide" style="padding-top:max(1.25rem, 5vw);padding-bottom:8rem"><!-- wp:site-title {"style":{"spacing":{"margin":{"top":"0px","bottom":"0px"}},"typography":{"fontStyle":"normal","fontWeight":"700"}}} /--> | ||
|
||
<!-- wp:navigation {"itemsJustification":"right","isResponsive":true} --> | ||
<!-- wp:page-list {"isNavigationChild":true,"showSubmenuIcon":true,"openSubmenusOnClick":false} /--> | ||
<!-- /wp:navigation --></div> | ||
<!-- /wp:group -->', | ||
); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I update the navigation in the standard header, and I go to insert a new header from one of these patterns, it pulls in the old / original navigation. Is there a way to get the pattern to pull in a navigation template part, i.e. the nav that I've updated already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet! But there's some early work in WordPress/gutenberg#35418 to help make that sort of thing happen. I suggest we hold on and see how that shakes out before implementing any sort of workarounds here.