Skip to content
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
2 changes: 1 addition & 1 deletion build/admin-settings-rtl.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/admin-settings.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '2d737052835da4af032b');
<?php return array('dependencies' => array(), 'version' => '362715ca3d611fafb6ab');
2 changes: 1 addition & 1 deletion build/admin-settings.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Telemetry/telemetry-init.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function (): void {
),
// Setting events.
array(
'action_hook' => 'load-settings_page_parsely',
'action_hook' => 'load-parse-ly_page_parsely-settings',
'callable' => 'Parsely\Telemetry\record_settings_page_loaded',
),
array(
Expand Down
13 changes: 5 additions & 8 deletions src/UI/class-dashboard-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,14 +175,11 @@ public function add_dashboard_page_to_menu(): void {
'__return_null'
);

add_submenu_page(
'parsely-dashboard-page',
'Parse.ly Settings',
'Settings',
Parsely::CAPABILITY, // phpcs:ignore WordPress.WP.Capabilities.Undetermined
'parsely-dashboard-page#/settings',
'__return_null'
);
/**
* Settings submenu is registered in add_settings_sub_menu() at src/UI/class-settings-page.php.
*
* @see Settings_Page::add_settings_sub_menu()
*/
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/UI/class-recommended-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public function widget( $args, $widget_settings ): void /* @phpstan-ignore-line
*/
public function form( $current_settings ): string {
if ( ! $this->site_id_and_secret_are_populated() ) {
$settings_page_url = add_query_arg( 'page', 'parsely', get_admin_url() . 'options-general.php' );
$settings_page_url = add_query_arg( 'page', 'parsely-settings', get_admin_url() . 'admin.php' );

$message = sprintf(
/* translators: %s: Plugin settings page URL */
Expand Down
9 changes: 5 additions & 4 deletions src/UI/class-settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function run(): void {
* @param string|null $hook_suffix The current page being loaded.
*/
public function enqueue_settings_assets( ?string $hook_suffix ): void {
if ( ! is_string( $hook_suffix ) || 'settings_page_parsely' !== $hook_suffix ) {
if ( ! is_string( $hook_suffix ) || $this->hook_suffix !== $hook_suffix ) {
return;
}

Expand Down Expand Up @@ -190,9 +190,10 @@ public function enqueue_settings_assets( ?string $hook_suffix ): void {
* Adds the Parse.ly settings page in WordPress settings menu.
*/
public function add_settings_sub_menu(): void {
$suffix = add_options_page(
$suffix = add_submenu_page(
'parsely-dashboard-page',
__( 'Parse.ly Settings', 'wp-parsely' ),
__( 'Parse.ly', 'wp-parsely' ),
__( 'Settings', 'wp-parsely' ),
Parsely::CAPABILITY, // phpcs:ignore WordPress.WP.Capabilities.Undetermined
Parsely::MENU_SLUG,
array( $this, 'display_settings' )
Expand Down Expand Up @@ -228,7 +229,7 @@ public function add_help_text(): void {
}

/**
* Displays the Parse.ly settings screen (options-general.php?page=[SLUG]).
* Displays the Parse.ly settings screen (admin.php?page=[SLUG]).
*/
public function display_settings(): void {
// phpcs:ignore WordPress.WP.Capabilities.Undetermined
Expand Down
2 changes: 1 addition & 1 deletion src/UI/class-site-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function check_site_id( array $tests ): array {
if ( $this->parsely->site_id_is_missing() ) {
$result['status'] = 'critical';
$result['label'] = __( 'You need to provide the Site ID', 'wp-parsely' );
$result['actions'] = __( 'The site ID can be set in the <a href="/wp-admin/options-general.php?page=parsely">Parse.ly Settings Page</a>.', 'wp-parsely' );
$result['actions'] = __( 'The site ID can be set in the <a href="/wp-admin/admin.php?page=parsely-settings">Parse.ly Settings Page</a>.', 'wp-parsely' );
}

return $result;
Expand Down
2 changes: 2 additions & 0 deletions src/UI/settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<h1 class="wp-heading-inline"><?php echo esc_html_e( 'Parse.ly Settings', 'wp-parsely' ); ?></h1>
<span id="wp-parsely_version"><?php echo esc_html( $parsely_version_string ); ?></span>

<?php settings_errors(); ?>

<?php $wp_parsely_settings->show_setting_tabs(); ?>

<form name="parsely" method="post" action='options.php' novalidate hidden>
Expand Down
4 changes: 2 additions & 2 deletions src/class-parsely.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Parsely {
* Declare our constants
*/
public const VERSION = PARSELY_VERSION;
public const MENU_SLUG = 'parsely'; // The page param passed to options-general.php.
public const MENU_SLUG = 'parsely-settings'; // The page param passed to admin.php.
public const OPTIONS_KEY = 'parsely'; // The key used to store options in the WP database.
public const CAPABILITY = 'manage_options'; // The capability required to administer settings.
public const DASHBOARD_BASE_URL = 'https://dash.parsely.com';
Expand Down Expand Up @@ -685,7 +685,7 @@ public function set_default_content_helper_settings_values(): void {
* @return string
*/
public static function get_settings_url( ?int $_blog_id = null ): string {
return get_admin_url( $_blog_id, 'options-general.php?page=' . self::MENU_SLUG );
return get_admin_url( $_blog_id, 'admin.php?page=' . self::MENU_SLUG );
}

/**
Expand Down
Loading
Loading