PluginProbe
Elementor Website Builder – more than just a page builder / 3.6.0-dev10
Elementor Website Builder – more than just a page builder v3.6.0-dev10
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 / wp-api.php

wp-api.php in Elementor Website Builder – more than just a page builder 3.6.0-dev10, at core/wp-api.php

40 lines 769 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Core;
3
4 use Elementor\Core\Utils\Collection;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10 /**
11 * This class is responsible for the interaction with WordPress Core API.
12 * The main benefit is making it easy to mock in testing
13 * and it can help to create unit tests without the hustle of mocking WordPress itself.
14 */
15 class Wp_Api {
16 /**
17 * @var Collection
18 */
19 private $plugins;
20
21 /**
22 * @return Collection
23 */
24 public function get_plugins() {
25 if ( ! $this->plugins ) {
26 $this->plugins = new Collection( get_plugins() );
27 }
28
29 return $this->plugins;
30 }
31
32 /**
33 * @return Collection
34 */
35 public function get_active_plugins() {
36 return $this->get_plugins()
37 ->only( get_option( 'active_plugins' ) );
38 }
39 }
40