PluginProbe
Elementor Website Builder – more than just a page builder / 4.1.5
Elementor Website Builder – more than just a page builder v4.1.5
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / core / isolation / wordpress-adapter.php

wordpress-adapter.php in Elementor Website Builder – more than just a page builder 4.1.5, at core/isolation/wordpress-adapter.php

98 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Core\Isolation;
4
5 use Elementor\Core\Settings\Manager;
6 use Elementor\Core\Upgrade\Manager as Upgrade_Manager;
7
8 class Wordpress_Adapter implements Wordpress_Adapter_Interface {
9
10 public function get_plugins(): array {
11 return get_plugins();
12 }
13
14 public function is_plugin_active( $plugin_path ): bool {
15 return is_plugin_active( $plugin_path );
16 }
17
18 public function wp_nonce_url( $url, $action ): string {
19 return wp_nonce_url( $url, $action );
20 }
21
22 public function self_admin_url( $path ): string {
23 return self_admin_url( $path );
24 }
25
26 /**
27 * Retrieves an array of pages (or hierarchical post type items).
28 *
29 * @return WP_Post[]|false Array of pages (or hierarchical post type items). Boolean false if the
30 * specified post type is not hierarchical or the specified status is not
31 * supported by the post type.
32 */
33 public function get_pages( $args ): ?array {
34 return get_pages( $args );
35 }
36
37 /**
38 * Creates and returns a wp query instance.
39 *
40 * @return \WP_Query
41 */
42 public function get_query( $args ): ?\WP_Query {
43 return new \WP_Query( $args );
44 }
45
46 public function get_option( $option_key ) {
47 return get_option( $option_key );
48 }
49
50 public function update_option( $option_key, $option_value ): void {
51 update_option( $option_key, $option_value );
52 }
53
54 public function add_option( $option_key, $option_value ): void {
55 add_option( $option_key, $option_value );
56 }
57
58 public function get_user_preferences( $preference_key ) {
59 return Manager::get_settings_managers( 'editorPreferences' )
60 ->get_model()
61 ->get_settings( $preference_key );
62 }
63
64 public function set_user_preferences( $preference_key, $value ) {
65 Manager::get_settings_managers( 'editorPreferences' )
66 ->get_model()
67 ->set_settings( $preference_key, $value );
68 }
69
70 public function is_new_installation() {
71 return Upgrade_Manager::is_new_installation();
72 }
73
74 public function add_query_arg( $args, $url ): string {
75 return add_query_arg( $args, $url );
76 }
77
78 public function has_custom_logo(): bool {
79 return has_custom_logo();
80 }
81
82 public function current_user_can( $capability, $args ): bool {
83 return current_user_can( $capability, $args );
84 }
85
86 public function get_post_status( $post_id ): string {
87 return get_post_status( $post_id );
88 }
89
90 public function get_posts( $args ): array {
91 return get_posts( $args );
92 }
93
94 public function get_post_types( $args = [], $output = 'names', $operator = 'and' ): array {
95 return get_post_types( $args, $output, $operator );
96 }
97 }
98