Skip to content

Commit

Permalink
Merge pull request #17 from peiche/1.0.2
Browse files Browse the repository at this point in the history
1.0.2
  • Loading branch information
peiche authored Oct 30, 2023
2 parents e062508 + 092996a commit 91e59ac
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 137 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Change Log

## 1.0.2

- Moved anonymous functions to named functions.

## 1.0.1

- Added PHPCS to lint PHP files.
- Fixed PHP errors and warnings.

## 1.0.0

- Initial release.
37 changes: 19 additions & 18 deletions inc/block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,25 @@
* @since Ankur 1.0
*/

add_action(
'init',
function () {
$block_pattern_categories = array(
'author' => array( 'label' => __( 'Author', 'ankur' ) ),
'banner' => array( 'label' => __( 'Banner', 'ankur' ) ),
'card' => array( 'label' => __( 'Card', 'ankur' ) ),
'header' => array( 'label' => __( 'Header', 'ankur' ) ),
'hero' => array( 'label' => __( 'Hero', 'ankur' ) ),
'quote' => array( 'label' => __( 'Quote', 'ankur' ) ),
);
/**
* Register custom block patterns.
*/
function ankur_register_block_patterns() {
$block_pattern_categories = array(
'author' => array( 'label' => __( 'Author', 'ankur' ) ),
'banner' => array( 'label' => __( 'Banner', 'ankur' ) ),
'card' => array( 'label' => __( 'Card', 'ankur' ) ),
'header' => array( 'label' => __( 'Header', 'ankur' ) ),
'hero' => array( 'label' => __( 'Hero', 'ankur' ) ),
'quote' => array( 'label' => __( 'Quote', 'ankur' ) ),
);

foreach ( $block_pattern_categories as $name => $properties ) {
foreach ( $block_pattern_categories as $name => $properties ) {

if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( $name ) ) {
register_block_pattern_category( $name, $properties );
}
if ( ! WP_Block_Pattern_Categories_Registry::get_instance()->is_registered( $name ) ) {
register_block_pattern_category( $name, $properties );
}
},
9
);
}
}

add_action( 'init', 'ankur_register_block_patterns', 9 );
232 changes: 117 additions & 115 deletions inc/block-styles.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,128 +6,130 @@
* @since Ankur 1.0
*/

add_action(
'init',
function () {
register_block_style(
'core/button',
array(
'name' => 'underline',
'label' => __( 'Underline', 'ankur' ),
'attributes' => array(
'className' => 'is-style-underline',
),
)
);
/**
* Register custom block styles.
*/
function ankur_register_block_styles() {
register_block_style(
'core/button',
array(
'name' => 'underline',
'label' => __( 'Underline', 'ankur' ),
'attributes' => array(
'className' => 'is-style-underline',
),
)
);

register_block_style(
'core/query-pagination',
array(
'name' => 'buttons',
'label' => __( 'Buttons', 'ankur' ),
'attributes' => array(
'className' => 'is-style-buttons',
),
)
);

register_block_style(
'core/query-pagination',
array(
'name' => 'buttons',
'label' => __( 'Buttons', 'ankur' ),
'attributes' => array(
'className' => 'is-style-buttons',
),
)
);
register_block_style(
'core/post-terms',
array(
'name' => 'buttons',
'label' => __( 'Buttons', 'ankur' ),
'attributes' => array(
'className' => 'is-style-buttons',
),
)
);

register_block_style(
'core/post-terms',
array(
'name' => 'buttons',
'label' => __( 'Buttons', 'ankur' ),
'attributes' => array(
'className' => 'is-style-buttons',
),
)
);
register_block_style(
'core/post-terms',
array(
'name' => 'outline',
'label' => __( 'Outline', 'ankur' ),
'attributes' => array(
'className' => 'is-style-outline',
),
)
);

register_block_style(
'core/post-terms',
array(
'name' => 'outline',
'label' => __( 'Outline', 'ankur' ),
'attributes' => array(
'className' => 'is-style-outline',
),
)
);
register_block_style(
'core/quote',
array(
'name' => 'large',
'label' => __( 'Large', 'ankur' ),
'attributes' => array(
'className' => 'is-style-large',
),
)
);

register_block_style(
'core/quote',
array(
'name' => 'large',
'label' => __( 'Large', 'ankur' ),
'attributes' => array(
'className' => 'is-style-large',
),
)
);
register_block_style(
'core/image',
array(
'name' => 'pill',
'label' => __( 'Pill', 'ankur' ),
'attributes' => array(
'className' => 'is-style-pill',
),
)
);

register_block_style(
'core/image',
array(
'name' => 'pill',
'label' => __( 'Pill', 'ankur' ),
'attributes' => array(
'className' => 'is-style-pill',
),
)
);
register_block_style(
'core/embed',
array(
'name' => 'rounded',
'label' => __( 'Rounded', 'ankur' ),
'attributes' => array(
'className' => 'is-style-rounded',
),
)
);

register_block_style(
'core/embed',
array(
'name' => 'rounded',
'label' => __( 'Rounded', 'ankur' ),
'attributes' => array(
'className' => 'is-style-rounded',
),
)
);
register_block_style(
'core/gallery',
array(
'name' => 'diamond',
'label' => __( 'Diamond', 'ankur' ),
'attributes' => array(
'className' => 'is-style-diamond',
),
)
);

register_block_style(
'core/gallery',
array(
'name' => 'diamond',
'label' => __( 'Diamond', 'ankur' ),
'attributes' => array(
'className' => 'is-style-diamond',
),
)
);
register_block_style(
'core/media-text',
array(
'name' => 'overlap',
'label' => __( 'Text Overlap', 'ankur' ),
'attributes' => array(
'className' => 'is-style-overlap',
),
)
);

register_block_style(
'core/media-text',
array(
'name' => 'overlap',
'label' => __( 'Text Overlap', 'ankur' ),
'attributes' => array(
'className' => 'is-style-overlap',
),
)
);
register_block_style(
'core/cover',
array(
'name' => 'rounded',
'label' => __( 'Rounded', 'ankur' ),
'attributes' => array(
'className' => 'is-style-rounded',
),
)
);

register_block_style(
'core/cover',
array(
'name' => 'rounded',
'label' => __( 'Rounded', 'ankur' ),
'attributes' => array(
'className' => 'is-style-rounded',
),
)
);
register_block_style(
'core/video',
array(
'name' => 'rounded',
'label' => __( 'Rounded', 'ankur' ),
'attributes' => array(
'className' => 'is-style-rounded',
),
)
);
}

register_block_style(
'core/video',
array(
'name' => 'rounded',
'label' => __( 'Rounded', 'ankur' ),
'attributes' => array(
'className' => 'is-style-rounded',
),
)
);
}
);
add_action( 'init', 'ankur_register_block_styles' );
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ankur",
"version": "1.0.1",
"version": "1.0.2",
"description": "WordPress block theme supporting full site editing",
"scripts": {
"lint:css": "wp-scripts lint-style \"src/**/*.scss\"",
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Theme Name: Ankur
Author: Paul Eiche
Description: WordPress block theme with support for color variations and custom patterns.
Version: 1.0.1
Version: 1.0.2
Requires at least: 5.9
Tested up to: 6.0
Requires PHP: 7.4
Expand Down

0 comments on commit 91e59ac

Please sign in to comment.