diff --git a/includes/classes/SiteAutomation/Request.php b/includes/classes/SiteAutomation/Request.php index 9fc4cf2a..f5f79cf2 100644 --- a/includes/classes/SiteAutomation/Request.php +++ b/includes/classes/SiteAutomation/Request.php @@ -176,7 +176,7 @@ private function set_status( $data ) { ); if ( empty( $data['success'] ) ) { - $data['retry'] = $this->status['retry'] + 1; + $data['retry'] = is_array( $this->status ) ? $this->status['retry'] + 1 : 1; } else { $data['retry'] = 0; } diff --git a/includes/functions/blocks.php b/includes/functions/blocks.php index d7bfc8d8..0b0036b2 100644 --- a/includes/functions/blocks.php +++ b/includes/functions/blocks.php @@ -19,7 +19,7 @@ function setup() { return __NAMESPACE__ . "\\$function"; }; - add_filter( 'block_categories', $n( 'blocks_categories' ), 10, 2 ); + add_filter( 'block_categories_all', $n( 'blocks_categories' ), 10, 2 ); register_blocks(); } @@ -41,13 +41,13 @@ function register_blocks() { /** * Filters the registered block categories. * - * @param array $categories Registered categories. - * @param object $post The post object. + * @param array $categories array Registered categories. + * @param object $block_editor_context WP_Block_Editor_Context The current block editor context. * * @return array Filtered categories. */ -function blocks_categories( $categories, $post ) { - if ( ! in_array( $post->post_type, get_supported_post_types(), true ) ) { +function blocks_categories( $categories, $block_editor_context ) { + if ( ! in_array( $block_editor_context->post->post_type, get_supported_post_types(), true ) ) { return $categories; }