page.php (1714B)
1 <?php 2 namespace Elementor\Modules\Library\Documents; 3 4 use Elementor\Core\DocumentTypes\Post; 5 6 if ( ! defined( 'ABSPATH' ) ) { 7 exit; // Exit if accessed directly 8 } 9 10 /** 11 * Elementor page library document. 12 * 13 * Elementor page library document handler class is responsible for 14 * handling a document of a page type. 15 * 16 * @since 2.0.0 17 */ 18 class Page extends Library_Document { 19 20 /** 21 * Get document properties. 22 * 23 * Retrieve the document properties. 24 * 25 * @since 2.0.0 26 * @access public 27 * @static 28 * 29 * @return array Document properties. 30 */ 31 public static function get_properties() { 32 $properties = parent::get_properties(); 33 34 $properties['support_wp_page_templates'] = true; 35 $properties['support_kit'] = true; 36 37 return $properties; 38 } 39 40 public static function get_type() { 41 return 'page'; 42 } 43 44 /** 45 * Get document title. 46 * 47 * Retrieve the document title. 48 * 49 * @since 2.0.0 50 * @access public 51 * @static 52 * 53 * @return string Document title. 54 */ 55 public static function get_title() { 56 return esc_html__( 'Page', 'elementor' ); 57 } 58 59 public static function get_plural_title() { 60 return __( 'Pages', 'elementor' ); 61 } 62 63 /** 64 * @since 2.1.3 65 * @access public 66 */ 67 public function get_css_wrapper_selector() { 68 return 'body.elementor-page-' . $this->get_main_id(); 69 } 70 71 /** 72 * @since 3.1.0 73 * @access protected 74 */ 75 protected function register_controls() { 76 parent::register_controls(); 77 78 Post::register_hide_title_control( $this ); 79 80 Post::register_style_controls( $this ); 81 } 82 83 protected function get_remote_library_config() { 84 $config = parent::get_remote_library_config(); 85 86 $config['type'] = 'page'; 87 $config['default_route'] = 'templates/pages'; 88 89 return $config; 90 } 91 }