Skip to content

Commit

Permalink
Instead of hiding, don't add it instead - covers simple and atomic.
Browse files Browse the repository at this point in the history
  • Loading branch information
lsl committed Jan 17, 2025
1 parent 6cf27c6 commit 44b01f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,10 @@ public function add_options_menu() {
// @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.
add_submenu_page( 'options-general.php', esc_attr__( 'Podcasting', 'jetpack-masterbar' ), __( 'Podcasting', 'jetpack-masterbar' ), 'manage_options', 'https://wordpress.com/settings/podcasting/' . $this->domain, null, 8 );
// @phan-suppress-next-line PhanTypeMismatchArgumentProbablyReal -- Core should ideally document null for no-callback arg. https://core.trac.wordpress.org/ticket/52539.

Check failure on line 398 in projects/packages/masterbar/src/admin-menu/class-admin-menu.php

View workflow job for this annotation

GitHub Actions / Static analysis

Plugin UnusedPluginSuppression Plugin BuiltinSuppressionPlugin suppresses issue PhanTypeMismatchArgumentProbablyReal on this line but this suppression is unused or suppressed elsewhere
add_submenu_page( 'options-general.php', esc_attr__( 'Performance', 'jetpack-masterbar' ), __( 'Performance', 'jetpack-masterbar' ), 'manage_options', 'https://wordpress.com/settings/performance/' . $this->domain, null, 9 );

if ( function_exists( 'wpcom_is_duplicate_views_experiment_enabled' ) && ! wpcom_is_duplicate_views_experiment_enabled() ) {
add_submenu_page( 'options-general.php', esc_attr__( 'Performance', 'jetpack-masterbar' ), __( 'Performance', 'jetpack-masterbar' ), 'manage_options', 'https://wordpress.com/settings/performance/' . $this->domain, null, 9 );

Check failure on line 401 in projects/packages/masterbar/src/admin-menu/class-admin-menu.php

View workflow job for this annotation

GitHub Actions / Static analysis

TypeError PhanTypeMismatchArgumentProbablyReal Argument 6 ($callback) is null of type null but \add_submenu_page() takes callable|string (no real type) defined at /home/runner/work/jetpack/jetpack/vendor/php-stubs/wordpress-stubs/wordpress-stubs.php:87545 (the inferred real argument type has nothing in common with the parameter's phpdoc type)
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ function_exists( 'wpcom_is_duplicate_views_experiment_enabled' ) &&

// Hide Settings > Performance when the interface is set to wp-admin.
// This is due to these settings are mostly also available in Jetpack > Settings, in the Performance tab.
if ( $this->use_wp_admin_interface() || ( function_exists( 'wpcom_is_duplicate_views_experiment_enabled' ) && wpcom_is_duplicate_views_experiment_enabled() ) ) {
if ( $this->use_wp_admin_interface() ) {
$this->hide_submenu_page( 'options-general.php', 'https://wordpress.com/settings/performance/' . $this->domain );
}
}
Expand Down

0 comments on commit 44b01f6

Please sign in to comment.