PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 19.0
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v19.0
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 / src / integrations / admin / redirects-integration.php

redirects-integration.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 19.0, at src/integrations/admin/redirects-integration.php

68 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yoast\WP\SEO\Integrations\Admin;
4
5 use WPSEO_Admin_Utils;
6 use WPSEO_Shortlinker;
7 use Yoast\WP\SEO\Conditionals\Admin_Conditional;
8 use Yoast\WP\SEO\Conditionals\Premium_Inactive_Conditional;
9 use Yoast\WP\SEO\Integrations\Integration_Interface;
10
11 /**
12 * Redirects_Integration class.
13 */
14 class Redirects_Integration implements Integration_Interface {
15
16 /**
17 * Sets up the hooks.
18 *
19 * @return void
20 */
21 public function register_hooks() {
22 \add_filter( 'wpseo_submenu_pages', [ $this, 'add_submenu_page' ], 9 );
23 }
24
25 /**
26 * Returns the conditionals based on which this loadable should be active.
27 *
28 * In this case: only when on an admin page and Premium is not active.
29 *
30 * @return array The conditionals.
31 */
32 public static function get_conditionals() {
33 return [
34 Admin_Conditional::class,
35 Premium_Inactive_Conditional::class,
36 ];
37 }
38
39 /**
40 * Adds the redirects submenu page.
41 *
42 * @param array $submenu_pages The Yoast SEO submenu pages.
43 *
44 * @return array The filtered submenu pages.
45 */
46 public function add_submenu_page( $submenu_pages ) {
47 $submenu_pages[] = [
48 'wpseo_dashboard',
49 '',
50 __( 'Redirects', 'wordpress-seo' ) . ' <span class="yoast-badge yoast-premium-badge"></span>',
51 'edit_others_posts',
52 'wpseo_redirects',
53 [ $this, 'display' ],
54 ];
55
56 return $submenu_pages;
57 }
58
59 /**
60 * Displays the redirects page.
61 *
62 * @return void
63 */
64 public function display() {
65 require WPSEO_PATH . 'admin/pages/redirects.php';
66 }
67 }
68