Skip to content
Open
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
16 changes: 16 additions & 0 deletions wp-maintenance-mode.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,22 @@ function () {
}
);

add_filter(
'wp_maintenance_mode_support_hub_metadata',
function () {
return array(
'is_pro' => false,
'links' => array(
array(
'icon' => 'groups',
'text' => __( 'Community Forum', 'wp-maintenance-mode' ),
'url' => 'https://wordpress.org/support/plugin/wp-maintenance-mode/',
),
),
);
}
);
Comment on lines +114 to +128

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

tests This filter is new behavior, and no PHPUnit test covers it. tests/bootstrap.php loads this file, so the suite can reach it. Add a case to a test file in tests/, for example tests/generic-test.php. Call apply_filters( 'wp_maintenance_mode_support_hub_metadata', array() ). Assert that is_pro is false. Assert that links[0]['url'] is https://wordpress.org/support/plugin/wp-maintenance-mode/. Without this change the filter returns the empty default, so the test fails.


/**
* Filter products array.
*
Expand Down
Loading