Skip to content

Commit

Permalink
Introduce block pattern categories, reorg.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgardner committed May 22, 2023
1 parent bc5884a commit 9484297
Show file tree
Hide file tree
Showing 21 changed files with 46 additions and 20 deletions.
26 changes: 26 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,29 @@ function frost_register_block_styles() {
}
}
add_action( 'init', 'frost_register_block_styles' );

/**
* Register block pattern categories.
*
* @since 1.0.4
*/
function frost_register_block_pattern_categories() {

register_block_pattern_category(
'page',
array(
'label' => __( 'Page', 'frost' ),
'description' => __( 'Create a full page with multiple patterns that are grouped together.', 'frost' ),
)
);
register_block_pattern_category(
'pricing',
array(
'label' => __( 'Pricing', 'frost' ),
'description' => __( 'Compare features for your digital products or service plans.', 'frost' ),
)
);

}

add_action( 'init', 'frost_register_block_pattern_categories' );
2 changes: 1 addition & 1 deletion patterns/general-author-box-contrast-background.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Box with image, text, social icons.
* Slug: frost/general-author-box-contrast-background
* Categories: featured
* Categories: call-to-action
*/
?>
<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|small","right":"var:preset|spacing|small","bottom":"var:preset|spacing|small","left":"var:preset|spacing|small"},"blockGap":"var:preset|spacing|x-small"},"elements":{"link":{"color":{"text":"var:preset|color|base"}}}},"backgroundColor":"contrast","textColor":"base","layout":{"type":"constrained"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/general-author-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Box with image, text, social icons.
* Slug: frost/general-author-box
* Categories: featured
* Categories: call-to-action
*/
?>
<!-- wp:group {"style":{"border":{"width":"1px"},"spacing":{"padding":{"top":"var:preset|spacing|small","right":"var:preset|spacing|small","bottom":"var:preset|spacing|small","left":"var:preset|spacing|small"},"blockGap":"var:preset|spacing|x-small"}},"borderColor":"contrast","layout":{"type":"constrained"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/general-boxes-three-contrast-background.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Boxes with heading, text, button.
* Slug: frost/general-boxes-three-contrast-background
* Categories: text
* Categories: featured
*/
?>
<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/general-boxes-three.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Boxes with heading, text, button.
* Slug: frost/general-boxes-three
* Categories: text
* Categories: featured
*/
?>
<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/general-boxes-two-contrast-background.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Boxes with heading, text, button.
* Slug: frost/general-boxes-two-contrast-background
* Categories: text
* Categories: featured
*/
?>
<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/general-boxes-two.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Boxes with heading, text, button.
* Slug: frost/general-boxes-two
* Categories: text
* Categories: featured
*/
?>
<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/general-newsletter-signup-contrast-background.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Box with heading, text.
* Slug: frost/general-newsletter-signup-contrast-background
* Categories: featured
* Categories: call-to-action
*/
?>
<!-- wp:group {"style":{"elements":{"link":{"color":{"text":"var:preset|color|base"}}},"spacing":{"padding":{"top":"var:preset|spacing|medium","right":"var:preset|spacing|medium","bottom":"var:preset|spacing|medium","left":"var:preset|spacing|medium"}}},"backgroundColor":"contrast","textColor":"base","className":"stacked","layout":{"type":"default"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/general-newsletter-signup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Box with heading, text.
* Slug: frost/general-newsletter-signup
* Categories: featured
* Categories: call-to-action
*/
?>
<!-- wp:group {"style":{"border":{"width":"1px"},"spacing":{"padding":{"top":"var:preset|spacing|medium","right":"var:preset|spacing|medium","bottom":"var:preset|spacing|medium","left":"var:preset|spacing|medium"}}},"borderColor":"contrast","className":"stacked","layout":{"type":"default"}} -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Pricing table with heading, list, buttons.
* Slug: frost/general-pricing-four-columns-contrast-background
* Categories: featured
* Categories: pricing
*/
?>
<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/general-pricing-four-columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Pricing table with heading, list, buttons.
* Slug: frost/general-pricing-four-columns
* Categories: featured
* Categories: pricing
*/
?>
<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Pricing table with heading, list, buttons.
* Slug: frost/general-pricing-three-columns-contrast-background
* Categories: featured
* Categories: pricing
*/
?>
<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/general-pricing-three-columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Pricing table with heading, list, buttons.
* Slug: frost/general-pricing-three-columns
* Categories: featured
* Categories: pricing
*/
?>
<!-- wp:group {"align":"wide","layout":{"type":"default"}} -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Pricing table with heading, list, buttons.
* Slug: frost/general-pricing-two-columns-contrast-background
* Categories: featured
* Categories: pricing
*/
?>
<!-- wp:group {"align":"wide","layout":{"type":"constrained","wideSize":"800px"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/general-pricing-two-columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Pricing table with heading, list, buttons.
* Slug: frost/general-pricing-two-columns-main
* Categories: featured
* Categories: pricing
*/
?>
<!-- wp:group {"align":"wide","layout":{"type":"constrained","wideSize":"800px"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/general-product-box-contrast-background.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Box with image, heading, text, button.
* Slug: frost/general-product-box-contrast-background
* Categories: text
* Categories: call-to-action
*/
?>
<!-- wp:group {"style":{"spacing":{"padding":{"top":"var:preset|spacing|small","right":"var:preset|spacing|small","bottom":"var:preset|spacing|small","left":"var:preset|spacing|small"}}},"backgroundColor":"contrast","textColor":"base","className":"stacked","layout":{"type":"default"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/general-product-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Box with image, heading, text, button.
* Slug: frost/general-product-box
* Categories: text
* Categories: call-to-action
*/
?>
<!-- wp:group {"style":{"border":{"width":"1px"},"spacing":{"padding":{"top":"var:preset|spacing|small","right":"var:preset|spacing|small","bottom":"var:preset|spacing|small","left":"var:preset|spacing|small"}}},"borderColor":"contrast","className":"stacked","layout":{"type":"default"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/page-about.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Sample about page.
* Slug: frost/page-about
* Categories: featured
* Categories: page
*/
?>
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"top":"70px","bottom":"var:preset|spacing|x-large","right":"30px","left":"30px"}}},"layout":{"type":"constrained"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/page-home.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Sample home page.
* Slug: frost/page-home
* Categories: featured
* Categories: page
*/
?>
<!-- wp:group {"align":"full","style":{"spacing":{"padding":{"right":"30px","bottom":"var:preset|spacing|x-large","left":"30px","top":"70px"},"margin":{"top":"0px"},"blockGap":"10px"}},"className":"welcome","layout":{"type":"constrained","wideSize":"800px"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/page-link.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Sample link page.
* Slug: frost/page-link
* Categories: featured
* Categories: page
*/
?>
<!-- wp:group {"align":"full","style":{"spacing":{"margin":{"top":"0px"},"padding":{"left":"0px","top":"var:preset|spacing|large","right":"0px","bottom":"var:preset|spacing|large"}},"dimensions":{"minHeight":"100vh"}},"layout":{"type":"flex","flexWrap":"nowrap","justifyContent":"center"}} -->
Expand Down
2 changes: 1 addition & 1 deletion patterns/page-pricing.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Title: Sample pricing page.
* Slug: frost/page-pricing
* Categories: featured
* Categories: page
*/
?>
<!-- wp:group {"align":"wide","style":{"spacing":{"padding":{"top":"var:preset|spacing|small","bottom":"var:preset|spacing|large"}}},"layout":{"type":"constrained"}} -->
Expand Down

0 comments on commit 9484297

Please sign in to comment.