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

Avoid disjointed plugin settings #200

Merged
merged 3 commits into from
Jun 30, 2022
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 2 additions & 2 deletions restricted_site_access.php
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ public static function admin_init() {

// settings for restricted site access.
register_setting( self::$settings_page, 'rsa_options', array( __CLASS__, 'sanitize_options' ) ); // array of fundamental options including ID and caching info.
add_settings_section( 'restricted-site-access', '', '__return_empty_string', self::$settings_page );
add_settings_section( 'restricted-site-access', __( 'Restricted Site Access', 'restricted-site-access' ), '__return_empty_string', self::$settings_page );

// Limit when additional settings fields show up.
if (
Expand Down Expand Up @@ -955,7 +955,7 @@ public static function admin_head() {
$screen->add_help_tab(
array(
'id' => 'restricted-site-access',
'title' => esc_html_x( 'Restricted Site Acccess', 'help screen title', 'restricted-site-access' ),
'title' => esc_html_x( 'Restricted Site Access', 'help screen title', 'restricted-site-access' ),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although this change is unrelated to the issue at hand, I included it so translators can manage two identical strings in once change.

'content' => implode( PHP_EOL, $content ),
)
);
Expand Down
2 changes: 1 addition & 1 deletion tests/php/test-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public function test_admin_head() {
$tabs = $screen->get_help_tabs();

$this->assertArrayHasKey( 'restricted-site-access', $tabs );
$this->assertSame( 'Restricted Site Acccess', $tabs['restricted-site-access']['title'] );
$this->assertSame( 'Restricted Site Access', $tabs['restricted-site-access']['title'] );

$content = $tabs['restricted-site-access']['content'];

Expand Down