PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.0
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.0
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 19.1 All 128 releases
wordpress-seo / src / wordpress / wrapper.php

wrapper.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.0, at src/wordpress/wrapper.php

75 lines 1.4 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\WordPress;
4
5 use wpdb;
6 use WPSEO_Addon_Manager;
7 use WPSEO_Admin_Asset_Manager;
8 use WPSEO_Replace_Vars;
9 use WPSEO_Shortlinker;
10 use WPSEO_Utils;
11
12 /**
13 * Wrapper class for WordPress globals.
14 *
15 * This consists of factory functions to inject WP globals into the dependency container.
16 */
17 class Wrapper {
18
19 /**
20 * Wrapper method for returning the wpdb object for use in dependency injection.
21 *
22 * @return wpdb The wpdb global.
23 */
24 public static function get_wpdb() {
25 global $wpdb;
26
27 return $wpdb;
28 }
29
30 /**
31 * Factory function for replace vars helper.
32 *
33 * @return WPSEO_Replace_Vars The replace vars helper.
34 */
35 public static function get_replace_vars() {
36 return new WPSEO_Replace_Vars();
37 }
38
39 /**
40 * Factory function for the admin asset manager.
41 *
42 * @return WPSEO_Admin_Asset_Manager The admin asset manager.
43 */
44 public static function get_admin_asset_manager() {
45 return new WPSEO_Admin_Asset_Manager();
46 }
47
48 /**
49 * Factory function for the addon manager.
50 *
51 * @return WPSEO_Addon_Manager The addon manager.
52 */
53 public static function get_addon_manager() {
54 return new WPSEO_Addon_Manager();
55 }
56
57 /**
58 * Factory function for the shortlinker.
59 *
60 * @return WPSEO_Shortlinker
61 */
62 public static function get_shortlinker() {
63 return new WPSEO_Shortlinker();
64 }
65
66 /**
67 * Factory function for the utils class.
68 *
69 * @return WPSEO_Utils
70 */
71 public static function get_utils() {
72 return new WPSEO_Utils();
73 }
74 }
75