PluginProbe
Elementor Website Builder – more than just a page builder / 3.28.0-dev2
Elementor Website Builder – more than just a page builder v3.28.0-dev2
4.3.0-beta3 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 All 452 releases
← All changes | core/frontend/render-mode-manager.php +1 -33 4.1.0-dev33.28.0-dev2 View file →
@@ -2,9 +2,8 @@
2 2 namespace Elementor\Core\Frontend;
3 3
4 4 use Elementor\Core\Frontend\RenderModes\Render_Mode_Base;
5 5 use Elementor\Core\Frontend\RenderModes\Render_Mode_Normal;
6 -use Elementor\Modules\CloudLibrary\Render_Mode_Preview;
7 6
8 7 if ( ! defined( 'ABSPATH' ) ) {
9 8 exit; // Exit if accessed directly.
10 9 }
@@ -11,11 +10,8 @@
11 10
12 11 class Render_Mode_Manager {
13 12 const QUERY_STRING_PARAM_NAME = 'render_mode';
14 13 const QUERY_STRING_POST_ID = 'post_id';
15 -
16 - const QUERY_STRING_TEMPLATE_ID = 'template_id';
17 -
18 14 const QUERY_STRING_NONCE_PARAM_NAME = 'render_mode_nonce';
19 15 const NONCE_ACTION_PATTERN = 'render_mode_{post_id}';
20 16
21 17 /**
@@ -96,12 +92,10 @@
96 92 * @return $this
97 93 */
98 94 private function choose_render_mode() {
99 95 $post_id = null;
100 - $template_id = null;
101 96 $key = null;
102 97 $nonce = null;
103 - $kit_preview = null;
104 98
105 99 if ( isset( $_GET[ self::QUERY_STRING_POST_ID ] ) ) {
106 100 $post_id = $_GET[ self::QUERY_STRING_POST_ID ]; // phpcs:ignore -- Nonce will be checked next line.
107 101 }
@@ -113,12 +107,8 @@
113 107 if ( isset( $_GET[ self::QUERY_STRING_PARAM_NAME ] ) ) {
114 108 $key = $_GET[ self::QUERY_STRING_PARAM_NAME ]; // phpcs:ignore -- Nonce will be checked next line.
115 109 }
116 110
117 - if ( isset( $_GET[ self::QUERY_STRING_TEMPLATE_ID ] ) ) {
118 - $template_id = $_GET[ self::QUERY_STRING_TEMPLATE_ID ]; // phpcs:ignore -- Nonce will be checked next line.
119 - }
120 -
121 111 if (
122 112 $post_id &&
123 113 $nonce &&
124 114 wp_verify_nonce( $nonce, self::get_nonce_action( $post_id ) ) &&
@@ -125,10 +115,8 @@
125 115 $key &&
126 116 array_key_exists( $key, $this->render_modes )
127 117 ) {
128 118 $this->set_current( new $this->render_modes[ $key ]( $post_id ) );
129 - } elseif ( $this->is_template_preview_mode( $template_id, $key, $nonce ) ) {
130 - $this->set_current( new $this->render_modes[ $key ]( $template_id ) );
131 119 } else {
132 120 $this->set_current( new Render_Mode_Normal( $post_id ) );
133 121 }
134 122
@@ -134,33 +122,13 @@
134 122
135 123 return $this;
136 124 }
137 125
138 - private function is_template_preview_mode( $template_id, $render_mode, $nonce ) {
139 - if ( empty( $template_id ) ) {
140 - return false;
141 - }
142 -
143 - if ( Render_Mode_Preview::MODE !== $render_mode ) {
144 - return false;
145 - }
146 -
147 - if ( ! array_key_exists( $render_mode, $this->render_modes ) ) {
148 - return false;
149 - }
150 -
151 - if ( ! wp_verify_nonce( $nonce, self::get_nonce_action( $template_id ) ) ) {
152 - wp_die( esc_html__( 'Not Authorized', 'elementor' ), esc_html__( 'Error', 'elementor' ), 403 );
153 - }
154 -
155 - return true;
156 - }
157 -
158 126 /**
159 127 * Add actions base on the current render.
160 128 *
161 129 * @throws \Requests_Exception_HTTP_403 If the current render mode does not have the required permissions.
162 - * @throws \WpOrg\Requests\Exception\Http\Status403 If the current render mode does not have the required permissions.
130 + * @throws Status403 If the current render mode does not have the required permissions.
163 131 */
164 132 private function add_current_actions() {
165 133 if ( ! $this->current->get_permissions_callback() ) {
166 134 // WP >= 6.2-alpha