Skip to content

Commit

Permalink
Merge pull request #292 from globeandmail/fix/270
Browse files Browse the repository at this point in the history
fix/270: undefined array offset
  • Loading branch information
jeffpaul authored May 23, 2022
2 parents 3ba2d49 + 05af5fd commit 13e86c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion includes/classes/SiteAutomation/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
10 changes: 5 additions & 5 deletions includes/functions/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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;
}

Expand Down

0 comments on commit 13e86c6

Please sign in to comment.