Skip to content

Commit

Permalink
Update to use conditional.
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsoo committed Sep 19, 2024
1 parent 871fb27 commit 2d87ca4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions admin/class-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

use Yoast\WP\SEO\Actions\Alert_Dismissal_Action;
use Yoast\WP\SEO\Dashboard\User_Interface\New_Dashboard_Page_Integration;
use Yoast\WP\SEO\Conditionals\New_Dashboard_Ui_Conditional;
use Yoast\WP\SEO\Integrations\Academy_Integration;
use Yoast\WP\SEO\Integrations\Settings_Integration;
use Yoast\WP\SEO\Integrations\Support_Integration;
Expand Down Expand Up @@ -48,9 +48,10 @@ public function __construct() {
* @return void
*/
public function init() {
$conditional = new New_Dashboard_Ui_Conditional();
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
$page = isset( $_GET['page'] ) && is_string( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : '';
if ( in_array( $page, [ Settings_Integration::PAGE, Academy_Integration::PAGE, Support_Integration::PAGE, New_Dashboard_Page_Integration::PAGE ], true ) ) {
if ( in_array( $page, [ Settings_Integration::PAGE, Academy_Integration::PAGE, Support_Integration::PAGE ], true ) || $conditional->is_met() ) {
// Bail, this is managed in the applicable integration.
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ public function expect_get_script_data() {
->andReturn( false );

Monkey\Functions\expect( 'is_rtl' )->once()->andReturn( false );

Monkey\Functions\expect( 'add_query_arg' )->once();
Monkey\Functions\expect( 'admin_url' )->once();
Monkey\Functions\expect( 'plugins_url' )
->once()
->andReturn( 'http://basic.wordpress.test/wp-content/worspress-seo' );
Expand Down

0 comments on commit 2d87ca4

Please sign in to comment.