PluginProbe
Elementor Website Builder – more than just a page builder / 4.2.0
Elementor Website Builder – more than just a page builder v4.2.0
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 / files / css / post-preview.php

post-preview.php in Elementor Website Builder – more than just a page builder 4.2.0, at core/files/css/post-preview.php

66 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Core\Files\CSS;
3
4 use Elementor\Plugin;
5
6 if ( ! defined( 'ABSPATH' ) ) {
7 exit; // Exit if accessed directly.
8 }
9
10 /**
11 * Elementor post preview CSS file.
12 *
13 * Elementor CSS file handler class is responsible for generating the post
14 * preview CSS file.
15 *
16 * @since 1.9.0
17 */
18 class Post_Preview extends Post_Local_Cache {
19
20 /**
21 * Preview ID.
22 *
23 * Holds the ID of the current post being previewed.
24 *
25 * @var int
26 */
27 private $post_id_for_data;
28
29 /**
30 * Post preview CSS file constructor.
31 *
32 * Initializing the CSS file of the post preview. Set the post ID and the
33 * parent ID and initiate the stylesheet.
34 *
35 * @since 1.9.0
36 * @access public
37 *
38 * @param int $post_id Post ID.
39 */
40 public function __construct( $post_id ) {
41 $this->post_id_for_data = $post_id;
42
43 $parent_id = wp_get_post_parent_id( $post_id );
44
45 parent::__construct( $parent_id );
46 }
47
48 protected function get_post_id_for_data() {
49 return $this->post_id_for_data;
50 }
51
52 /**
53 * Get file handle ID.
54 *
55 * Retrieve the handle ID for the previewed post CSS file.
56 *
57 * @since 1.9.0
58 * @access protected
59 *
60 * @return string CSS file handle ID.
61 */
62 protected function get_file_handle_id() {
63 return 'elementor-preview-' . $this->get_post_id_for_data();
64 }
65 }
66