PluginProbe
Elementor Website Builder – more than just a page builder / 3.19.4
Elementor Website Builder – more than just a page builder v3.19.4
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 -18 4.2.03.19.4 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 */
@@ -239,12 +238,8 @@
239 238 public static function is_current_user_can_upload_json() {
240 239 return current_user_can( 'manage_options' ) || ! Plugin::instance()->role_manager->user_can( 'json-upload' );
241 240 }
242 241
243 - public static function is_current_user_can_use_custom_html() {
244 - return current_user_can( 'manage_options' ) || ! Plugin::instance()->role_manager->user_can( 'custom-html' );
245 - }
246 -
247 242 /**
248 243 * Set admin notice as viewed.
249 244 *
250 245 * Flag the admin notice as viewed by the current user, using an authenticated ajax request.
@@ -262,10 +257,8 @@
262 257 if ( ! $notice_id ) {
263 258 wp_die();
264 259 }
265 260
266 - check_admin_referer( 'elementor_set_admin_notice_viewed' );
267 -
268 261 self::set_user_notice( $notice_id );
269 262
270 263 if ( ! wp_doing_ajax() ) {
271 264 wp_safe_redirect( admin_url() );
@@ -275,11 +268,11 @@
275 268 wp_die();
276 269 }
277 270
278 271 /**
279 - * @param string $notice_id
280 - * @param bool $is_viewed
281 - * @param array $meta
272 + * @param $notice_id
273 + * @param $is_viewed
274 + * @param $meta
282 275 *
283 276 * @return void
284 277 */
285 278 public static function set_user_notice( $notice_id, $is_viewed = true, $meta = null ) {
@@ -310,13 +303,13 @@
310 303 update_user_meta( get_current_user_id(), self::INTRODUCTION_KEY, $user_introduction_meta );
311 304 }
312 305
313 306 /**
314 - * @throws \Exception If the user cannot install plugins.
307 + * @throws \Exception
315 308 */
316 309 public static function register_as_beta_tester( array $data ) {
317 310 if ( ! current_user_can( 'install_plugins' ) ) {
318 - 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' ) );
319 312 }
320 313
321 314 update_user_meta( get_current_user_id(), self::BETA_TESTER_META_KEY, true );
322 315 $response = wp_safe_remote_post(
@@ -362,20 +355,20 @@
362 355 return $user_introduction_meta;
363 356 }
364 357
365 358 /**
366 - * Get a user option with a fallback value.
359 + * Get a user option with default value as fallback.
367 360 *
368 - * @param string $option Option key.
369 - * @param int $user_id User ID.
370 - * @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.
371 364 *
372 365 * @return mixed
373 366 */
374 - 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 ) {
375 368 $value = get_user_option( $option, $user_id );
376 369
377 - return ( false === $value ) ? $fallback : $value;
370 + return ( false === $value ) ? $default : $value;
378 371 }
379 372
380 373 /**
381 374 * Get dismissed editor notices.