Skip to content

Commit

Permalink
update: ensure notice scope before scope wise filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
mralaminahamed committed Nov 25, 2024
1 parent 4064478 commit b519b09
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion includes/REST/AdminNoticeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ public function dokan_get_admin_notices( WP_REST_Request $request ) {
$filter_notices = array_filter(
$notices,
function ( $notice ) use ( $notice_scope ) {
return $notice['scope'] === ( $notice_scope ?? 'local' );
$notice['scope'] = $notice['scope'] ?? 'local';

return $notice['scope'] === $notice_scope;
}
);
$filter_notices = array_values( $filter_notices );
Expand Down

0 comments on commit b519b09

Please sign in to comment.