Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLANET-7561 Remove Blank Page pattern #1217

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions classes/patterns/class-blankpage.php

This file was deleted.

1 change: 0 additions & 1 deletion classes/patterns/class-block-pattern.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public static function get_classname(): string {
*/
public static function get_list(): array {
return [
BlankPage::class,
DeepDive::class,
DeepDiveTopic::class,
GetInformed::class,
Expand Down
10 changes: 3 additions & 7 deletions classes/search/pattern/class-patternusageapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
namespace P4GBKS\Search\Pattern;

use WP_Block_Patterns_Registry;
use P4GBKS\Patterns\BlankPage;
use P4GBKS\Search\Pattern\Query\Parameters;

/**
Expand Down Expand Up @@ -77,12 +76,9 @@ private function fetch_items(): void {
* Get all patterns names
*/
private function pattern_names(): array {
return array_filter(
Copy link
Contributor Author

@mleray mleray Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure how to solve this issue, but I figured this was an OK fix for now since we already have an open PR to move this report to the theme, which will need to be updated anyways

array_column(
( WP_Block_Patterns_Registry::get_instance() )->get_all_registered(),
'name'
),
fn ( $name ) => BlankPage::get_name() !== $name
return array_column(
( WP_Block_Patterns_Registry::get_instance() )->get_all_registered(),
'name'
);
}

Expand Down
10 changes: 3 additions & 7 deletions classes/search/pattern/class-patternusagetable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use InvalidArgumentException;
use WP_List_Table;
use WP_Block_Patterns_Registry;
use P4GBKS\Patterns\BlankPage;
use P4GBKS\Search\RowActions;
use P4GBKS\Search\Pattern\Query\Parameters;

Expand Down Expand Up @@ -95,12 +94,9 @@ public function __construct( $args = [] ) {
);
}

$this->pattern_names = array_filter(
array_column(
$this->pattern_registry->get_all_registered(),
'name'
),
fn ( $name ) => BlankPage::get_name() !== $name
$this->pattern_names = array_column(
$this->pattern_registry->get_all_registered(),
'name'
);
}

Expand Down