Skip to content

Commit

Permalink
27.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
inc2734 committed Oct 18, 2024
1 parent 41e0bb5 commit c559636
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
20 changes: 17 additions & 3 deletions app/setup/remote-block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @package snow-monkey
* @author inc2734
* @license GPL-2.0+
* @version 27.2.5
* @version 27.2.6
*/

use Framework\Controller\Manager;
Expand Down Expand Up @@ -174,8 +174,16 @@ function snow_monkey_register_remote_block_patterns() {
$remote_block_pattern_categories = $transient;
} else {
$remote_block_pattern_categories = snow_monkey_get_remote_block_patten_categories();
set_transient( 'snow-monkey-remote-pattern-categories', $remote_block_pattern_categories, DAY_IN_SECONDS );

if ( $remote_block_pattern_categories && is_array( $remote_block_pattern_categories ) ) {
set_transient( 'snow-monkey-remote-pattern-categories', $remote_block_pattern_categories, DAY_IN_SECONDS );
}
}

if ( ! is_array( $remote_block_pattern_categories ) ) {
$remote_block_pattern_categories = array();
}

foreach ( $remote_block_pattern_categories as $remote_block_pattern_category ) {
register_block_pattern_category(
$remote_block_pattern_category['name'],
Expand Down Expand Up @@ -209,7 +217,13 @@ function snow_monkey_register_remote_block_patterns() {
$remote_block_patterns = snow_monkey_get_free_remote_block_pattens();
}

set_transient( 'snow-monkey-remote-patterns', $remote_block_patterns, DAY_IN_SECONDS );
if ( $remote_block_patterns && is_array( $remote_block_patterns ) ) {
set_transient( 'snow-monkey-remote-patterns', $remote_block_patterns, DAY_IN_SECONDS );
}
}

if ( ! is_array( $remote_block_patterns ) ) {
$remote_block_patterns = array();
}

$registry = WP_Block_Patterns_Registry::get_instance();
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Theme URI: https://snow-monkey.2inc.org
Author: inc2734
Author URI: https://2inc.org
Description:
Version: 27.2.5
Version: 27.2.6
License: GPLv2 or later
License URI: license.txt
Tags: editor-style, featured-images
Expand Down

0 comments on commit c559636

Please sign in to comment.