PluginProbe
Elementor Website Builder – more than just a page builder / 3.20.3
Elementor Website Builder – more than just a page builder v3.20.3
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
← All changes | includes/user.php +11 -14 4.1.0-dev33.20.3 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 */
@@ -262,10 +261,8 @@
262 261 if ( ! $notice_id ) {
263 262 wp_die();
264 263 }
265 264
266 - check_admin_referer( 'elementor_set_admin_notice_viewed' );
267 -
268 265 self::set_user_notice( $notice_id );
269 266
270 267 if ( ! wp_doing_ajax() ) {
271 268 wp_safe_redirect( admin_url() );
@@ -275,11 +272,11 @@
275 272 wp_die();
276 273 }
277 274
278 275 /**
279 - * @param string $notice_id
280 - * @param bool $is_viewed
281 - * @param array $meta
276 + * @param $notice_id
277 + * @param $is_viewed
278 + * @param $meta
282 279 *
283 280 * @return void
284 281 */
285 282 public static function set_user_notice( $notice_id, $is_viewed = true, $meta = null ) {
@@ -310,13 +307,13 @@
310 307 update_user_meta( get_current_user_id(), self::INTRODUCTION_KEY, $user_introduction_meta );
311 308 }
312 309
313 310 /**
314 - * @throws \Exception If the user cannot install plugins.
311 + * @throws \Exception
315 312 */
316 313 public static function register_as_beta_tester( array $data ) {
317 314 if ( ! current_user_can( 'install_plugins' ) ) {
318 - throw new \Exception( 'You do not have permission to install plugins.' );
315 + throw new \Exception( __( 'You do not have permissions to install plugins on this site.', 'elementor' ) );
319 316 }
320 317
321 318 update_user_meta( get_current_user_id(), self::BETA_TESTER_META_KEY, true );
322 319 $response = wp_safe_remote_post(
@@ -362,20 +359,20 @@
362 359 return $user_introduction_meta;
363 360 }
364 361
365 362 /**
366 - * Get a user option with a fallback value.
363 + * Get a user option with default value as fallback.
367 364 *
368 - * @param string $option Option key.
369 - * @param int $user_id User ID.
370 - * @param mixed $fallback Default fallback value.
365 + * @param string $option - Option key.
366 + * @param int $user_id - User ID
367 + * @param mixed $default - Default fallback value.
371 368 *
372 369 * @return mixed
373 370 */
374 - public static function get_user_option_with_default( $option, $user_id, $fallback ) {
371 + public static function get_user_option_with_default( $option, $user_id, $default ) {
375 372 $value = get_user_option( $option, $user_id );
376 373
377 - return ( false === $value ) ? $fallback : $value;
374 + return ( false === $value ) ? $default : $value;
378 375 }
379 376
380 377 /**
381 378 * Get dismissed editor notices.