| 1 |
<?php |
| 2 |
namespace Elementor\Core\Isolation; |
| 3 |
|
| 4 |
class Wordpress_Adapter implements Wordpress_Adapter_Interface { |
| 5 |
|
| 6 |
public function get_plugins(): array { |
| 7 |
return get_plugins(); |
| 8 |
} |
| 9 |
|
| 10 |
public function is_plugin_active( $plugin_path ): bool { |
| 11 |
return is_plugin_active( $plugin_path ); |
| 12 |
} |
| 13 |
|
| 14 |
public function wp_nonce_url( $url, $action ): string { |
| 15 |
return wp_nonce_url( $url, $action ); |
| 16 |
} |
| 17 |
|
| 18 |
public function self_admin_url( $path ): string { |
| 19 |
return self_admin_url( $path ); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Retrieves an array of pages (or hierarchical post type items). |
| 24 |
* |
| 25 |
* @return WP_Post[]|false Array of pages (or hierarchical post type items). Boolean false if the |
| 26 |
* specified post type is not hierarchical or the specified status is not |
| 27 |
* supported by the post type. |
| 28 |
*/ |
| 29 |
public function get_pages( $args ) : ?array { |
| 30 |
return get_pages( $args ); |
| 31 |
} |
| 32 |
|
| 33 |
public function get_option( $option_key ) { |
| 34 |
return get_option( $option_key ); |
| 35 |
} |
| 36 |
|
| 37 |
public function update_option( $option_key, $option_value ) : void { |
| 38 |
update_option( $option_key, $option_value ); |
| 39 |
} |
| 40 |
|
| 41 |
public function add_option( $option_key, $option_value ) : void { |
| 42 |
add_option( $option_key, $option_value ); |
| 43 |
} |
| 44 |
|
| 45 |
public function current_user_can( $capability, $args ) : bool { |
| 46 |
return current_user_can( $capability, $args ); |
| 47 |
} |
| 48 |
|
| 49 |
public function get_post_status( $post_id ) : string { |
| 50 |
return get_post_status( $post_id ); |
| 51 |
} |
| 52 |
} |
| 53 |
|