Skip to content

Commit

Permalink
Merge pull request #31 from trustedlogin/issue/22-menu-item-php-warning
Browse files Browse the repository at this point in the history
Sanity check that $menu is set and is an array
  • Loading branch information
zackkatz committed Apr 19, 2022
2 parents f5495b5 + 1d8e9f0 commit 6058d0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion inc/class.rda-remove-access.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ public function hide_menus() {
/** @global array $menu */
global $menu;

$menu_ids = array();
if ( ! $menu || ! is_array( $menu ) ) {
return;
}

// Gather menu IDs (minus profile.php).
foreach ( $menu as $index => $values ) {
Expand Down
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ example.com/options-general.php?page=dashboard-access&rda_debug=1
= 1.1.4 on April 18, 2022 =

* Resolved: Issue when front-end editing of profiles when the `$pagenow` global is not defined ([#24](https://github.com/trustedlogin/Remove-Dashboard-Access/issues/24))
* Resolved: Potential `Invalid argument supplied for foreach()` PHP warning ([#22](https://github.com/trustedlogin/Remove-Dashboard-Access/pull/22))

= 1.1.3 =

* Fixed a compatibility issue with bbPress and the media grid view.
Expand Down

0 comments on commit 6058d0c

Please sign in to comment.