PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.4
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.4
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / vendor / wordproof / wordpress-sdk / app / Controllers / SettingsController.php

SettingsController.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 18.4, at vendor/wordproof/wordpress-sdk/app/Controllers/SettingsController.php

59 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace WordProof\SDK\Controllers;
4
5 use WordProof\SDK\Support\Settings;
6
7 class SettingsController
8 {
9 /**
10 * Redirects user to the settings page. Returns false if not authenticated.
11 *
12 * @param null|string $redirectUrl
13 * @return false
14 */
15 public function redirect($redirectUrl = null)
16 {
17 return Settings::redirect($redirectUrl);
18 }
19
20 /**
21 * Adds admin page that will redirect the user to a predefined url.
22 *
23 * @action admin_menu
24 */
25 public function addRedirectPage()
26 {
27 add_submenu_page(
28 null,
29 'WordProof Settings',
30 'WordProof Settings',
31 'publish_pages',
32 'wordproof-redirect-settings',
33 [$this, 'redirectPageContent']
34 );
35 }
36
37 /**
38 * The content for the redirect page. Triggered by addRedirectPage().
39 */
40 public function redirectPageContent()
41 {
42 return;
43 }
44
45 /**
46 * Redirects user on admin page load to the settings page on the WordProof My.
47 *
48 * @action load-admin_page_settings
49 */
50 public function redirectOnLoad()
51 {
52 $closeWindowUrl = admin_url('admin.php?page=wordproof-close-after-redirect');
53
54 if ($this->redirect($closeWindowUrl) === false) {
55 do_action('wordproof_authenticate', $closeWindowUrl);
56 }
57 }
58 }
59