PluginProbe
Elementor Website Builder – more than just a page builder / 3.19.2
Elementor Website Builder – more than just a page builder v3.19.2
4.3.1 4.3.0 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 All 454 releases
← All changes | includes/user.php +11 -22 4.3.03.19.2 View file →
@@ -72,9 +72,8 @@
72 72 add_action( 'elementor/ajax/register_actions', [ __CLASS__, 'register_ajax_actions' ] );
73 73 }
74 74
75 75 /**
76 - * @param Ajax $ajax
77 76 * @since 2.1.0
78 77 * @access public
79 78 * @static
80 79 */
@@ -126,12 +125,8 @@
126 125 if ( intval( get_option( 'page_for_posts' ) ) === $post->ID ) {
127 126 return false;
128 127 }
129 128
130 - if ( function_exists( 'wc_get_page_id' ) && intval( wc_get_page_id( 'shop' ) ) === $post->ID ) {
131 - return false;
132 - }
133 -
134 129 return true;
135 130 }
136 131
137 132 /**
@@ -243,12 +238,8 @@
243 238 public static function is_current_user_can_upload_json() {
244 239 return current_user_can( 'manage_options' ) || ! Plugin::instance()->role_manager->user_can( 'json-upload' );
245 240 }
246 241
247 - public static function is_current_user_can_use_custom_html() {
248 - return current_user_can( 'manage_options' ) || ! Plugin::instance()->role_manager->user_can( 'custom-html' );
249 - }
250 -
251 242 /**
252 243 * Set admin notice as viewed.
253 244 *
254 245 * Flag the admin notice as viewed by the current user, using an authenticated ajax request.
@@ -266,10 +257,8 @@
266 257 if ( ! $notice_id ) {
267 258 wp_die();
268 259 }
269 260
270 - check_admin_referer( 'elementor_set_admin_notice_viewed' );
271 -
272 261 self::set_user_notice( $notice_id );
273 262
274 263 if ( ! wp_doing_ajax() ) {
275 264 wp_safe_redirect( admin_url() );
@@ -279,11 +268,11 @@
279 268 wp_die();
280 269 }
281 270
282 271 /**
283 - * @param string $notice_id
284 - * @param bool $is_viewed
285 - * @param array $meta
272 + * @param $notice_id
273 + * @param $is_viewed
274 + * @param $meta
286 275 *
287 276 * @return void
288 277 */
289 278 public static function set_user_notice( $notice_id, $is_viewed = true, $meta = null ) {
@@ -314,13 +303,13 @@
314 303 update_user_meta( get_current_user_id(), self::INTRODUCTION_KEY, $user_introduction_meta );
315 304 }
316 305
317 306 /**
318 - * @throws \Exception If the user cannot install plugins.
307 + * @throws \Exception
319 308 */
320 309 public static function register_as_beta_tester( array $data ) {
321 310 if ( ! current_user_can( 'install_plugins' ) ) {
322 - throw new \Exception( 'You do not have permission to install plugins.' );
311 + throw new \Exception( __( 'You do not have permissions to install plugins on this site.', 'elementor' ) );
323 312 }
324 313
325 314 update_user_meta( get_current_user_id(), self::BETA_TESTER_META_KEY, true );
326 315 $response = wp_safe_remote_post(
@@ -366,20 +355,20 @@
366 355 return $user_introduction_meta;
367 356 }
368 357
369 358 /**
370 - * Get a user option with a fallback value.
359 + * Get a user option with default value as fallback.
371 360 *
372 - * @param string $option Option key.
373 - * @param int $user_id User ID.
374 - * @param mixed $fallback Default fallback value.
361 + * @param string $option - Option key.
362 + * @param int $user_id - User ID
363 + * @param mixed $default - Default fallback value.
375 364 *
376 365 * @return mixed
377 366 */
378 - public static function get_user_option_with_default( $option, $user_id, $fallback ) {
367 + public static function get_user_option_with_default( $option, $user_id, $default ) {
379 368 $value = get_user_option( $option, $user_id );
380 369
381 - return ( false === $value ) ? $fallback : $value;
370 + return ( false === $value ) ? $default : $value;
382 371 }
383 372
384 373 /**
385 374 * Get dismissed editor notices.