Skip to content
Closed
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
4 changes: 2 additions & 2 deletions src/UI/class-dashboard-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public function add_dashboard_page_to_menu(): void {
'Parse.ly Settings',
'Settings',
Parsely::CAPABILITY, // phpcs:ignore WordPress.WP.Capabilities.Undetermined
'parsely-dashboard-page#/settings',
Parsely::MENU_SLUG,
'__return_null'
);
}
Expand Down Expand Up @@ -261,7 +261,7 @@ public function enqueue_dashboard_page_scripts( ?string $hook_suffix ): void {

if ( $this->parsely->site_id_is_set() ) {
wp_add_inline_script(
'parsely-dashboard-page',
'parsely-dashboard-page',
'window.wpParselySiteId = ' . wp_json_encode( $this->parsely->get_site_id() ) . ';',
'before'
);
Expand Down
12 changes: 12 additions & 0 deletions src/UI/class-settings-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ public function __construct( Parsely $parsely ) {
*/
public function run(): void {
add_action( 'admin_menu', array( $this, 'add_settings_sub_menu' ) );
// Show the plugin's settings page only under the Parse.ly menu.
add_action( 'admin_head', array( $this, 'remove_settings_sub_menu' ) );
add_action( 'admin_init', array( $this, 'initialize_settings' ) );
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_settings_assets' ) );
}
Expand Down Expand Up @@ -206,6 +208,16 @@ public function add_settings_sub_menu(): void {
}
}

/**
* Removes the plugin's Settings page from the WordPress Settings menu,
* while still keeping the page available through its slug/URL.
*
* @since 3.18.0
*/
public function remove_settings_sub_menu(): void {
remove_submenu_page( 'options-general.php', Parsely::MENU_SLUG );
}

/**
* Adds the help tab to the settings page.
*
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">Parse.ly Settings Page</a>.', 'wp-parsely' );
}

return $result;
Expand Down
2 changes: 1 addition & 1 deletion src/content-helper/common/class-content-helper-feature.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ protected function get_credentials_not_set_message(): string {
'Existing Parse.ly customers can enable this feature by setting their Site ID and API Secret in ',
'wp-parsely'
) . '
<a href="/wp-admin/options-general.php?page=parsely" target="_blank" rel="noopener">' .
<a href="/wp-admin/admin.php?page=parsely" target="_blank" rel="noopener">' .
__( 'wp-parsely options.', 'wp-parsely' ) . '
</a>
</p>
Expand Down
Loading