PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 18.2
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v18.2
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 / wordpress / wrapper.php

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

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