Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.4.0 #110

Merged
merged 1 commit into from
Aug 30, 2024
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
5 changes: 4 additions & 1 deletion assets/build/utilities.css

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions assets/build/utilities.js.map

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

2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// Set Global Constants
if ( ! defined( 'NFD_WONDER_BLOCKS_VERSION' ) ) {
define( 'NFD_WONDER_BLOCKS_VERSION', '2.3.0' );
define( 'NFD_WONDER_BLOCKS_VERSION', '2.4.0' );
}
if ( ! defined( 'NFD_WONDER_BLOCKS_DIR' ) ) {
define( 'NFD_WONDER_BLOCKS_DIR', __DIR__ );
Expand Down
1 change: 0 additions & 1 deletion build/2.3.0/wonder-blocks-rtl.css

This file was deleted.

1 change: 0 additions & 1 deletion build/2.3.0/wonder-blocks.css

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions build/2.4.0/wonder-blocks-rtl.css

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '85a7e90b6f292b9e884c');
<?php return array('dependencies' => array('react', 'react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-dom-ready', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '122cf55bcddda13f1e20');
1 change: 1 addition & 0 deletions build/2.4.0/wonder-blocks.css

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/2.3.0/wonder-blocks.js → build/2.4.0/wonder-blocks.js

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions includes/Api/Controllers/CacheController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,51 +14,51 @@ public static function clear_cache( \WP_REST_Request $request ) {

$type = $request->get_param( 'type' );

$primary_type = SiteClassification::get_primary_type();
$primary_type = SiteClassification::get_primary_type();
$secondary_type = SiteClassification::get_secondary_type();

// Initialize response
$response = [];
// Initialize response
$response = array();

if ( ! $type || $type === 'patterns' ) {
// Clear cache for patterns
$pattern_request = new WonderBlocksFetchRequest(
if ( ! $type || $type === 'patterns' ) {
// Clear cache for patterns
$pattern_request = new WonderBlocksFetchRequest(
array(
'endpoint' => 'patterns',
'primary_type' => $primary_type,
'secondary_type' => $secondary_type,
)
);
WonderBlocks::clear_cache( $pattern_request );
$response['patterns'] = 'Cache cleared';
}
WonderBlocks::clear_cache( $pattern_request );
$response['patterns'] = 'Cache cleared';
}

if ( ! $type || $type === 'templates' ) {
// Clear cache for templates
$template_request = new WonderBlocksFetchRequest(
if ( ! $type || $type === 'templates' ) {
// Clear cache for templates
$template_request = new WonderBlocksFetchRequest(
array(
'endpoint' => 'templates',
'primary_type' => $primary_type,
'secondary_type' => $secondary_type,
)
);
WonderBlocks::clear_cache( $template_request );
$response['templates'] = 'Cache cleared';
}
WonderBlocks::clear_cache( $template_request );
$response['templates'] = 'Cache cleared';
}

if ( ! $type || $type === 'categories' ) {
if ( ! $type || $type === 'categories' ) {

// Clear cache for categories
$category_request = new WonderBlocksFetchRequest(
// Clear cache for categories
$category_request = new WonderBlocksFetchRequest(
array(
'endpoint' => 'categories',
'slug' => 'patterns',
'primary_type' => $primary_type,
'secondary_type' => $secondary_type,
)
);
WonderBlocks::clear_cache( $category_request );
WonderBlocks::clear_cache( $category_request );

$category_request = new WonderBlocksFetchRequest(
array(
'endpoint' => 'categories',
Expand All @@ -67,11 +67,11 @@ public static function clear_cache( \WP_REST_Request $request ) {
'secondary_type' => $secondary_type,
)
);
WonderBlocks::clear_cache( $category_request );
$response['categories'] = 'Cache cleared';
}
WonderBlocks::clear_cache( $category_request );

$response['categories'] = 'Cache cleared';
}

return new \WP_REST_Response( $response, 200 );
}
}
return new \WP_REST_Response( $response, 200 );
}
}
2 changes: 1 addition & 1 deletion includes/Api/RestApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function register_routes() {

RestApiController::post( '/events', array( EventsController::class, 'send' ), EventsController::get_send_event_args() );
RestApiController::post( '/events/batch', array( EventsController::class, 'send_batch' ) );

RestApiController::post( '/clear-cache', array( CacheController::class, 'clear_cache' ) );
}
}
28 changes: 14 additions & 14 deletions includes/BlockStyles.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@ class BlockStyles {
* Constructor to hook into WordPress.
*/
public function __construct() {
add_action( 'init', [ $this, 'register_block_styles' ] );
add_action( 'init', array( $this, 'register_block_styles' ) );
}

/**
* Register custom block styles for the core/group block.
*/
public function register_block_styles() {
$styles = [
[

$styles = array(
array(
'name' => 'nfd-theme-white',
'label' => __( 'White', 'nfd-wonder-blocks' ),
],
[
),
array(
'name' => 'nfd-theme-light',
'label' => __( 'Light', 'nfd-wonder-blocks' ),
],
[
),
array(
'name' => 'nfd-theme-dark',
'label' => __( 'Dark', 'nfd-wonder-blocks' ),
],
[
),
array(
'name' => 'nfd-theme-darker',
'label' => __( 'Darker', 'nfd-wonder-blocks' ),
],
[
),
array(
'name' => 'nfd-theme-primary',
'label' => __( 'Primary', 'nfd-wonder-blocks' ),
],
];
),
);

foreach ( $styles as $style ) {
register_block_style(
Expand Down
2 changes: 1 addition & 1 deletion includes/PatternsFeature.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ public function defineConstants( Container $container ) {
);
}
}
}
}
Loading