Skip to content

Commit b1ea88f

Browse files
committed
Update: Consolidate wizard submenu logic and bump Settings API to v2.8.1
1 parent 6c972c6 commit b1ea88f

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

includes/admin/settings/class-settings-api.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* Settings API wrapper class
2020
*
21-
* @version 2.8.0
21+
* @version 2.8.1
2222
*/
2323
class Settings_API {
2424

@@ -27,7 +27,7 @@ class Settings_API {
2727
*
2828
* @var string
2929
*/
30-
public const VERSION = '2.8.0';
30+
public const VERSION = '2.8.1';
3131

3232
/**
3333
* Settings Key.

includes/admin/settings/class-settings-wizard-api.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,10 @@ public function admin_menu() {
233233
array( $this, 'render_wizard_page' )
234234
);
235235

236-
$hide_when_completed = isset( $this->args['hide_when_completed'] ) ? (bool) $this->args['hide_when_completed'] : true;
237-
if ( $hide_when_completed && $this->is_wizard_completed() ) {
236+
$hide_submenu = ( isset( $this->args['show_in_menu'] ) && ! $this->args['show_in_menu'] ) ||
237+
( ( $this->args['hide_when_completed'] ?? true ) && $this->is_wizard_completed() );
238+
239+
if ( $hide_submenu ) {
238240
add_action( 'admin_head', array( $this, 'hide_completed_wizard_submenu' ) );
239241
}
240242
}
@@ -245,9 +247,6 @@ public function admin_menu() {
245247
* @return void
246248
*/
247249
public function hide_completed_wizard_submenu() {
248-
if ( ! $this->is_wizard_completed() ) {
249-
return;
250-
}
251250
$slug = sanitize_key( $this->page_slug );
252251
?>
253252
<style>

0 commit comments

Comments
 (0)