| 1 |
<?php |
| 2 |
namespace Elementor\Includes\Settings\AdminMenuItems; |
| 3 |
|
| 4 |
use Elementor\Core\Admin\Menu\Interfaces\Admin_Menu_Item_With_Page; |
| 5 |
use Elementor\Settings; |
| 6 |
|
| 7 |
if ( ! defined( 'ABSPATH' ) ) { |
| 8 |
exit; // Exit if accessed directly. |
| 9 |
} |
| 10 |
|
| 11 |
class Admin_Menu_Item implements Admin_Menu_Item_With_Page { |
| 12 |
private $settings_page; |
| 13 |
|
| 14 |
public function __construct( Settings $settings_page ) { |
| 15 |
$this->settings_page = $settings_page; |
| 16 |
} |
| 17 |
|
| 18 |
public function is_visible() { |
| 19 |
return true; |
| 20 |
} |
| 21 |
|
| 22 |
public function get_parent_slug() { |
| 23 |
return $this->settings_page->home_module->is_experiment_active() ? 'elementor' : null; |
| 24 |
} |
| 25 |
|
| 26 |
public function get_label() { |
| 27 |
return $this->settings_page->home_module->is_experiment_active() |
| 28 |
? esc_html__( 'Settings', 'elementor' ) |
| 29 |
: esc_html__( 'Elementor', 'elementor' ); |
| 30 |
} |
| 31 |
|
| 32 |
public function get_page_title() { |
| 33 |
return $this->get_label(); |
| 34 |
} |
| 35 |
|
| 36 |
public function get_position() { |
| 37 |
return '58.5'; |
| 38 |
} |
| 39 |
|
| 40 |
public function get_capability() { |
| 41 |
return 'manage_options'; |
| 42 |
} |
| 43 |
|
| 44 |
public function render() { |
| 45 |
$this->settings_page->display_settings_page(); |
| 46 |
} |
| 47 |
} |
| 48 |
|