PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.14
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.14
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/controllers/FrmStylesController.php +122 -347 6.336.14 View file →
@@ -19,20 +19,8 @@
19 19 * @var string|null
20 20 */
21 21 private static $message;
22 22
23 - /**
24 - * Cache of the active style object keyed by form ID.
25 - *
26 - * @since 6.32
27 - *
28 - * @var array
29 - */
30 - private static $active_style = array();
31 -
32 - /**
33 - * @return void
34 - */
35 23 public static function load_pro_hooks() {
36 24 if ( FrmAppHelper::pro_is_installed() ) {
37 25 FrmProStylesController::load_pro_hooks();
38 26 }
@@ -37,11 +25,8 @@
37 25 FrmProStylesController::load_pro_hooks();
38 26 }
39 27 }
40 28
41 - /**
42 - * @return void
43 - */
44 29 public static function register_post_types() {
45 30 register_post_type(
46 31 self::$post_type,
47 32 array(
@@ -82,10 +67,10 @@
82 67 *
83 68 * @return void
84 69 */
85 70 public static function menu() {
86 - add_submenu_page( 'formidable', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
87 - add_submenu_page( 'themes.php', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Forms', 'formidable' ), 'frm_change_settings', 'formidable-styles2', 'FrmStylesController::route' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
71 + add_submenu_page( 'formidable', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Styles', 'formidable' ), 'frm_change_settings', 'formidable-styles', 'FrmStylesController::route' );
72 + add_submenu_page( 'themes.php', 'Formidable | ' . __( 'Styles', 'formidable' ), __( 'Forms', 'formidable' ), 'frm_change_settings', 'formidable-styles2', 'FrmStylesController::route' );
88 73 }
89 74
90 75 /**
91 76 * Remove filters for the visual styler preview.
@@ -110,9 +95,9 @@
110 95 *
111 96 * @return void
112 97 */
113 98 private static function disable_form_css() {
114 - add_filter( 'get_frm_stylesheet', '__return_empty_array' );
99 + add_filter( 'get_frm_stylesheet', '__return_false' );
115 100 }
116 101
117 102 /**
118 103 * Removing this action prevents front end JavaScript from loading.
@@ -138,19 +123,19 @@
138 123 FrmStyleComponent::register_assets();
139 124 self::load_pro_hooks();
140 125
141 126 $version = FrmAppHelper::plugin_version();
127 + wp_enqueue_script( 'jquery-ui-datepicker' );
142 128
143 129 if ( FrmAppHelper::is_style_editor_page( 'edit' ) ) {
144 130 wp_enqueue_style( 'wp-color-picker' );
145 131 }
146 132
147 - wp_enqueue_style( 'frm-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_css&frm_scope_custom_css=1' ), array(), $version );
133 + wp_enqueue_style( 'frm-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_css' ), array(), $version );
148 134
149 135 $style = apply_filters( 'frm_style_head', false );
150 -
151 136 if ( $style ) {
152 - wp_enqueue_style( 'frm-single-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_load_css&flat=1' ) . '&' . http_build_query( $style->post_content ), array(), $version ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
137 + wp_enqueue_style( 'frm-single-custom-theme', admin_url( 'admin-ajax.php?action=frmpro_load_css&flat=1' ) . '&' . http_build_query( $style->post_content ), array(), $version );
153 138 }
154 139 }
155 140
156 141 /**
@@ -177,9 +162,8 @@
177 162
178 163 /**
179 164 * @param string $register Either 'enqueue' or 'register'.
180 165 * @param bool $force True to enqueue/register the style if a form has not been loaded.
181 - *
182 166 * @return void
183 167 */
184 168 public static function enqueue_css( $register = 'enqueue', $force = false ) {
185 169 global $frm_vars;
@@ -191,9 +175,8 @@
191 175 return;
192 176 }
193 177
194 178 $frm_settings = FrmAppHelper::get_settings();
195 -
196 179 if ( $frm_settings->load_style === 'none' ) {
197 180 return;
198 181 }
199 182
@@ -209,9 +192,8 @@
209 192 wp_register_style( $css_key, $file, array(), $this_version );
210 193 }
211 194
212 195 $load_on_all = ! FrmAppHelper::is_admin() && 'all' === $frm_settings->load_style;
213 -
214 196 if ( $load_on_all || $register !== 'register' ) {
215 197 wp_enqueue_style( $css_key );
216 198 }
217 199 unset( $css_key, $file );
@@ -242,22 +224,18 @@
242 224 }
243 225
244 226 /**
245 227 * @param array $stylesheet_urls
246 - *
247 228 * @return void
248 229 */
249 230 private static function get_url_to_custom_style( &$stylesheet_urls ) {
250 - $add_css_to_uploads_dir = FrmStyle::add_css_to_uploads_dir();
251 - $file_path = FrmStyle::get_generated_css_file_path( $add_css_to_uploads_dir ) . '/' . self::get_file_name();
252 -
253 - if ( ! is_readable( $file_path ) ) {
254 - $stylesheet_urls['formidable'] = admin_url( 'admin-ajax.php?action=frmpro_css' );
255 - return;
231 + $file_name = '/css/' . self::get_file_name();
232 + if ( is_readable( FrmAppHelper::plugin_path() . $file_name ) ) {
233 + $url = FrmAppHelper::plugin_url() . $file_name;
234 + } else {
235 + $url = admin_url( 'admin-ajax.php?action=frmpro_css' );
256 236 }
257 -
258 - $base_url = $add_css_to_uploads_dir ? wp_upload_dir()['baseurl'] . '/formidable/css/' : FrmAppHelper::plugin_url() . '/css/';
259 - $stylesheet_urls['formidable'] = $base_url . self::get_file_name();
237 + $stylesheet_urls['formidable'] = $url;
260 238 }
261 239
262 240 /**
263 241 * Use a different stylesheet per site in a multisite install
@@ -262,44 +240,42 @@
262 240 /**
263 241 * Use a different stylesheet per site in a multisite install
264 242 *
265 243 * @since 3.0.03
266 - *
267 - * @return string
268 244 */
269 245 public static function get_file_name() {
270 246 if ( is_multisite() ) {
271 - return 'formidableforms' . absint( get_current_blog_id() ) . '.css';
247 + $blog_id = get_current_blog_id();
248 + $name = 'formidableforms' . absint( $blog_id ) . '.css';
249 + } else {
250 + $name = 'formidableforms.css';
272 251 }
273 252
274 - return 'formidableforms.css';
253 + return $name;
275 254 }
276 255
277 - /**
278 - * @param string $css_key
279 - * @param string $version
280 - *
281 - * @return string
282 - */
283 256 private static function get_css_version( $css_key, $version ) {
284 - if ( 'formidable' !== $css_key ) {
285 - return $version;
257 + if ( 'formidable' == $css_key ) {
258 + $this_version = get_option( 'frm_last_style_update' );
259 + if ( ! $this_version ) {
260 + $this_version = $version;
261 + }
262 + } else {
263 + $this_version = $version;
286 264 }
287 265
288 - $this_version = get_option( 'frm_last_style_update' );
289 -
290 - return $this_version ? $this_version : $version;
266 + return $this_version;
291 267 }
292 268
293 269 /**
294 270 * @param string $tag
295 271 * @param string $handle
296 - *
297 272 * @return string
298 273 */
299 274 public static function add_tags_to_css( $tag, $handle ) {
300 - if ( ( 'formidable' === $handle || 'jquery-theme' === $handle ) && ! str_contains( $tag, ' property=' ) ) {
301 - return str_replace( ' type="', ' property="stylesheet" type="', $tag );
275 + if ( ( 'formidable' === $handle || 'jquery-theme' === $handle ) && strpos( $tag, ' property=' ) === false ) {
276 + $frm_settings = FrmAppHelper::get_settings();
277 + $tag = str_replace( ' type="', ' property="stylesheet" type="', $tag );
302 278 }
303 279
304 280 return $tag;
305 281 }
@@ -347,11 +323,10 @@
347 323
348 324 self::setup_styles_and_scripts_for_styler();
349 325
350 326 $style_id = self::get_style_id_for_styler();
351 -
352 327 if ( ! $style_id ) {
353 - $error_args = array(
328 + $error_args = array(
354 329 'title' => __( 'No styles', 'formidable' ),
355 330 'body' => __( 'You must have a style to use the Visual Styler.', 'formidable' ),
356 331 'cancel_url' => admin_url( 'admin.php?page=formidable' ),
357 332 );
@@ -359,9 +334,8 @@
359 334 return;
360 335 }
361 336
362 337 $form_id = FrmAppHelper::simple_get( 'form', 'absint', 0 );
363 -
364 338 if ( ! $form_id ) {
365 339 $form_id = self::get_form_id_for_style( $style_id );
366 340 }
367 341
@@ -367,9 +341,9 @@
367 341
368 342 $form = FrmForm::getOne( $form_id );
369 343
370 344 if ( ! is_object( $form ) ) {
371 - $error_args = array(
345 + $error_args = array(
372 346 'title' => __( 'No forms', 'formidable' ),
373 347 'body' => __( 'You must have a form to use the Visual Styler.', 'formidable' ),
374 348 'cancel_url' => admin_url( 'admin.php?page=formidable' ),
375 349 );
@@ -376,10 +350,11 @@
376 350 FrmAppController::show_error_modal( $error_args );
377 351 return;
378 352 }
379 353
380 - $frm_style = new FrmStyle( $style_id );
381 - $active_style = $frm_style->get_one();
354 + $frm_style = new FrmStyle( $style_id );
355 + $active_style = $frm_style->get_one();
356 + $default_style = self::get_default_style();
382 357
383 358 self::disable_admin_page_styling_on_submit_buttons();
384 359
385 360 /**
@@ -388,9 +363,9 @@
388 363 * @param array{form:\stdClass} $data
389 364 */
390 365 do_action( 'frm_before_render_style_page', compact( 'form' ) );
391 366
392 - self::render_style_page( $active_style, $form, self::get_default_style() );
367 + self::render_style_page( $active_style, $form, $default_style );
393 368 }
394 369
395 370 /**
396 371 * @since 6.0
@@ -398,9 +373,8 @@
398 373 * @return int
399 374 */
400 375 private static function get_style_id_for_styler() {
401 376 $action = FrmAppHelper::simple_get( 'frm_action' );
402 -
403 377 if ( 'duplicate' === $action ) {
404 378 // The duplicate action uses style_id instead of id for better backward compatibility.
405 379 return FrmAppHelper::simple_get( 'style_id', 'absint', 0 );
406 380 }
@@ -405,9 +379,8 @@
405 379 return FrmAppHelper::simple_get( 'style_id', 'absint', 0 );
406 380 }
407 381
408 382 $style_id = FrmAppHelper::simple_get( 'id', 'absint', 0 );
409 -
410 383 if ( $style_id ) {
411 384 // Always use the style ID from the URL if one is specified.
412 385 return $style_id;
413 386 }
@@ -412,9 +385,8 @@
412 385 return $style_id;
413 386 }
414 387
415 388 $request_form_id = FrmAppHelper::simple_get( 'form', 'absint', 0 );
416 -
417 389 if ( $request_form_id && is_callable( 'FrmProStylesController::get_active_style_for_form' ) ) {
418 390 return FrmProStylesController::get_active_style_for_form( $request_form_id )->ID;
419 391 }
420 392
@@ -426,9 +398,8 @@
426 398 *
427 399 * @since 6.0
428 400 *
429 401 * @param int $style_id
430 - *
431 402 * @return int
432 403 */
433 404 private static function get_form_id_for_style( $style_id ) {
434 405 $check = serialize( array( 'custom_style' => (string) $style_id ) );
@@ -441,8 +412,9 @@
441 412 )
442 413 );
443 414
444 415 if ( ! $form_id ) {
416 + // TODO: Show a message why a random form is being shown (because no form is assigned to the style).
445 417 // Fallback to any form.
446 418 $where = array(
447 419 'status' => 'published',
448 420 // Make sure it's not a repeater.
@@ -474,10 +446,11 @@
474 446 *
475 447 * @return WP_Post
476 448 */
477 449 private static function get_default_style() {
478 - $frm_style = new FrmStyle( 'default' );
479 - return $frm_style->get_one();
450 + $frm_style = new FrmStyle( 'default' );
451 + $default_style = $frm_style->get_one();
452 + return $default_style;
480 453 }
481 454
482 455 /**
483 456 * Save style for form (from Styler list page) via a POST action.
@@ -487,15 +460,13 @@
487 460 * @return void
488 461 */
489 462 private static function save_form_style() {
490 463 $permission_error = FrmAppHelper::permission_nonce_error( 'frm_edit_forms', 'frm_save_form_style', 'frm_save_form_style_nonce' );
491 -
492 464 if ( $permission_error !== false ) {
493 465 wp_die( 'Unable to save form', '', 403 );
494 466 }
495 467
496 468 $style_id = FrmAppHelper::get_post_param( 'style_id', 0, 'absint' );
497 -
498 469 if ( $style_id && ! self::confirm_style_exists_before_setting( $style_id ) ) {
499 470 wp_die( esc_html__( 'Invalid target style', 'formidable' ), esc_html__( 'Invalid target style', 'formidable' ), 400 );
500 471 return;
501 472 }
@@ -515,9 +486,8 @@
515 486 return;
516 487 }
517 488
518 489 $form_id = FrmAppHelper::get_post_param( 'form_id', 0, 'absint' );
519 -
520 490 if ( ! $form_id ) {
521 491 wp_die( esc_html__( 'No form specified', 'formidable' ), esc_html__( 'No form specified', 'formidable' ), 400 );
522 492 return;
523 493 }
@@ -522,21 +492,18 @@
522 492 return;
523 493 }
524 494
525 495 $form = FrmForm::getOne( $form_id );
526 -
527 496 if ( ! $form ) {
528 497 wp_die( esc_html__( 'Form does not exist', 'formidable' ), esc_html__( 'Form does not exist', 'formidable' ), 400 );
529 498 return;
530 499 }
531 500
532 - $previous_style_id = $form->options['custom_style'];
533 -
534 501 // If the default style is selected, use the "Always use default" legacy option instead of the default style.
535 502 // There's also a check here for conversational forms.
536 503 // Without the check it isn't possible to select "Default" because "Always use default" will convert to "Lines" dynamically.
537 -
538 - if ( $style_id === self::get_default_style()->ID && empty( $form->options['chat'] ) ) {
504 + $default_style = self::get_default_style();
505 + if ( $style_id === $default_style->ID && empty( $form->options['chat'] ) ) {
539 506 $style_id = 1;
540 507 }
541 508
542 509 // We want to save a string for consistency. FrmStylesHelper::get_form_count_for_style expects the custom style ID is a string.
@@ -541,27 +508,13 @@
541 508
542 509 // We want to save a string for consistency. FrmStylesHelper::get_form_count_for_style expects the custom style ID is a string.
543 510 $form->options['custom_style'] = (string) $style_id;
544 511
545 - if ( $previous_style_id === $form->options['custom_style'] ) {
546 - // Exit early before updating DB if nothing actually changed.
547 - self::$message = __( 'Successfully updated style.', 'formidable' );
548 - return;
549 - }
550 -
551 512 global $wpdb;
552 513 $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) );
553 514
554 515 FrmForm::clear_form_cache();
555 516
556 - /**
557 - * @since 6.25.1
558 - *
559 - * @param int $form_id
560 - * @param int $style_id
561 - */
562 - do_action( 'frm_after_changed_form_style', absint( $form_id ), absint( $style_id ) );
563 -
564 517 self::$message = __( 'Successfully updated style.', 'formidable' );
565 518 }
566 519
567 520 /**
@@ -567,9 +520,8 @@
567 520 /**
568 521 * Validate that we're assigning a form to a style that actually exists before assigning it to a form.
569 522 *
570 523 * @param int $style_id
571 - *
572 524 * @return bool True if the style actually exists.
573 525 */
574 526 private static function confirm_style_exists_before_setting( $style_id ) {
575 527 global $wpdb;
@@ -588,9 +540,9 @@
588 540 $plugin_url = FrmAppHelper::plugin_url();
589 541 $version = FrmAppHelper::plugin_version();
590 542 $js_dependencies = array( 'wp-i18n', 'wp-hooks', 'formidable_dom' );
591 543
592 - if ( FrmAppHelper::pro_is_installed() && is_callable( 'FrmProAppHelper::use_jquery_datepicker' ) && FrmProAppHelper::use_jquery_datepicker() ) {
544 + if ( FrmAppHelper::pro_is_installed() ) {
593 545 $js_dependencies[] = 'jquery-ui-datepicker';
594 546 }
595 547
596 548 wp_register_script( 'formidable_style', $plugin_url . '/js/admin/style.js', $js_dependencies, $version );
@@ -609,9 +561,8 @@
609 561 *
610 562 * @param stdClass|WP_Post $active_style
611 563 * @param stdClass $form
612 564 * @param WP_Post $default_style
613 - *
614 565 * @return void
615 566 */
616 567 private static function render_style_page( $active_style, $form, $default_style ) {
617 568 $style_views_path = self::get_views_path();
@@ -633,44 +584,22 @@
633 584 $style = $active_style;
634 585 break;
635 586
636 587 case 'duplicate':
637 - $style = clone $active_style;
638 - $new_style = $frm_style->get_new();
639 - $new_name = self::get_new_style_post_name( $new_style->post_name );
640 -
641 - // The single style custom CSS is nested under the old style's scope. Re-scope it to the
642 - // new style's scope so it unnests correctly for display and re-nests correctly on save.
643 - if ( ! empty( $style->post_content['single_style_custom_css'] ) ) {
644 - $css_scope_helper = new FrmCssScopeHelper();
645 - $unnested_css = $css_scope_helper->unnest( $style->post_content['single_style_custom_css'], 'frm_style_' . $style->post_name ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
646 - $style->post_content['single_style_custom_css'] = $css_scope_helper->nest( $unnested_css, 'frm_style_' . $new_name );
647 - }
648 -
588 + $style = clone $active_style;
589 + $new_style = $frm_style->get_new();
649 590 $style->ID = $new_style->ID;
650 - $style->post_name = $new_name;
651 - unset( $new_style, $new_name );
591 + $style->post_name = $new_style->post_name;
592 + unset( $new_style );
652 593 break;
653 594
654 595 case 'new_style':
655 - $style = $frm_style->get_new();
656 - $style->post_name = self::get_new_style_post_name( $style->post_name );
596 + $style = $frm_style->get_new();
657 597 break;
658 - }//end switch
598 + }
659 599
660 600 if ( in_array( $view, array( 'duplicate', 'new_style' ), true ) ) {
661 - // A new or duplicated style has no ID yet, so the Rename modal updates the post_title input
662 - // instead of calling an endpoint. Prefer that posted title over $_GET['style_name'] when present.
663 - $posted_title = '';
664 -
665 - // phpcs:ignore WordPress.Security.NonceVerification.Missing
666 - if ( isset( $_POST['frm_style_setting']['post_title'] ) ) {
667 - // The nonce is verified in FrmStylesController::save_style before this renders.
668 - // phpcs:ignore WordPress.Security.NonceVerification.Missing
669 - $posted_title = sanitize_text_field( wp_unslash( $_POST['frm_style_setting']['post_title'] ) );
670 - }
671 -
672 - $style->post_title = '' !== $posted_title ? $posted_title : FrmAppHelper::simple_get( 'style_name' );
601 + $style->post_title = FrmAppHelper::simple_get( 'style_name' );
673 602 $style->menu_order = 0;
674 603 }
675 604
676 605 if ( ! isset( $style ) ) {
@@ -694,27 +623,8 @@
694 623 include $style_views_path . 'show.php';
695 624 }
696 625
697 626 /**
698 - * Derive the temporary post_name (CSS scope slug) for a new or duplicated style from the chosen
699 - * style name so the displayed scope matches the slug WordPress will store on save.
700 - *
701 - * Falls back to the auto-generated key when no style name was provided so the scope is never empty.
702 - *
703 - * @since 6.32
704 - *
705 - * @param string $fallback The auto-generated post_name to use when no style name is chosen.
706 - *
707 - * @return string
708 - */
709 - private static function get_new_style_post_name( $fallback ) {
710 - $style_name = FrmAppHelper::simple_get( 'style_name' );
711 - $slug = $style_name ? sanitize_title( $style_name ) : '';
712 -
713 - return $slug ? $slug : $fallback;
714 - }
715 -
716 - /**
717 627 * @since 6.0
718 628 *
719 629 * @return string
720 630 */
@@ -727,9 +637,8 @@
727 637 *
728 638 * @since 6.0
729 639 *
730 640 * @param stdClass|WP_Post $style A new style is not a WP_Post object.
731 - *
732 641 * @return void
733 642 */
734 643 private static function force_form_style( $style ) {
735 644 add_filter(
@@ -740,9 +649,9 @@
740 649 /**
741 650 * @param string $class
742 651 */
743 652 function ( $class ) {
744 - return $class && ! str_starts_with( $class, 'frm_style_' );
653 + return $class && 0 !== strpos( $class, 'frm_style_' );
745 654 }
746 655 );
747 656 $split[] = 'frm_style_' . $style->post_name;
748 657 return implode( ' ', $split );
@@ -757,10 +666,8 @@
757 666 *
758 667 * @return void
759 668 */
760 669 public static function save_style() {
761 - FrmAppHelper::permission_check( 'frm_change_settings' );
762 -
763 670 $frm_style = new FrmStyle();
764 671 $post_id = FrmAppHelper::get_post_param( 'ID', false, 'sanitize_title' );
765 672 $style_nonce = FrmAppHelper::get_post_param( 'frm_style', '', 'sanitize_text_field' );
766 673
@@ -770,9 +677,8 @@
770 677 return;
771 678 }
772 679
773 680 $id = $frm_style->update( $post_id );
774 -
775 681 if ( ! $post_id && $id ) {
776 682 self::maybe_redirect_after_save( $id );
777 683 // Set the post id to the new style so it will be loaded for editing.
778 684 $post_id = reset( $id );
@@ -777,15 +683,8 @@
777 683 // Set the post id to the new style so it will be loaded for editing.
778 684 $post_id = reset( $id );
779 685 }
780 686
781 - /**
782 - * @since 6.25.1
783 - *
784 - * @param int $post_id
785 - */
786 - do_action( 'frm_after_saved_style', absint( $post_id ) );
787 -
788 687 self::$message = __( 'Your styling settings have been saved.', 'formidable' );
789 688 }
790 689
791 690 /**
@@ -804,20 +703,19 @@
804 703 *
805 704 * @since 6.0
806 705 *
807 706 * @param array $ids
808 - *
809 707 * @return void
810 708 */
811 709 private static function maybe_redirect_after_save( $ids ) {
812 - $referer = FrmAppHelper::get_server_value( 'HTTP_REFERER' );
813 - $parsed = parse_url( $referer );
814 - $query = $parsed['query'];
710 + $referer = FrmAppHelper::get_server_value( 'HTTP_REFERER' );
711 + $parsed = parse_url( $referer );
712 + $query = $parsed['query'];
713 +
815 714 $current_action = false;
816 715 $actions_to_redirect = array( 'duplicate', 'new_style' );
817 -
818 716 foreach ( $actions_to_redirect as $action ) {
819 - if ( str_contains( $query, 'frm_action=' . $action ) ) {
717 + if ( false !== strpos( $query, 'frm_action=' . $action ) ) {
820 718 $current_action = $action;
821 719 break;
822 720 }
823 721 }
@@ -827,9 +725,10 @@
827 725 return;
828 726 }
829 727
830 728 parse_str( $query, $parsed_query );
831 - $form_id = ! empty( $parsed_query['form'] ) ? absint( $parsed_query['form'] ) : 0;
729 + $form_id = ! empty( $parsed_query['form'] ) ? absint( $parsed_query['form'] ) : 0;
730 +
832 731 $style = new stdClass();
833 732 $style->ID = end( $ids );
834 733 wp_safe_redirect( esc_url_raw( FrmStylesHelper::get_edit_url( $style, $form_id ) ) );
835 734 die();
@@ -839,9 +738,8 @@
839 738 * @since 6.0
840 739 *
841 740 * @param string $message
842 741 * @param array|object $forms
843 - *
844 742 * @return void
845 743 */
846 744 public static function manage( $message = '', $forms = array() ) {
847 745 $frm_style = new FrmStyle();
@@ -846,9 +744,8 @@
846 744 public static function manage( $message = '', $forms = array() ) {
847 745 $frm_style = new FrmStyle();
848 746 $styles = $frm_style->get_all();
849 747 $default_style = $frm_style->get_default_style( $styles );
850 - $frm_settings = FrmAppHelper::get_settings();
851 748
852 749 if ( ! $forms ) {
853 750 $forms = FrmForm::get_published_forms();
854 751 }
@@ -865,16 +762,15 @@
865 762 private static function manage_styles() {
866 763 global $wpdb;
867 764
868 765 $forms = FrmForm::get_published_forms();
869 -
870 766 foreach ( $forms as $form ) {
871 - if ( ! isset( $_POST['style'] ) || ! isset( $_POST['style'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
767 + $new_style = isset( $_POST['style'] ) && isset( $_POST['style'][ $form->id ] ) ? sanitize_text_field( wp_unslash( $_POST['style'][ $form->id ] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
768 + $previous_style = isset( $_POST['prev_style'] ) && isset( $_POST['prev_style'][ $form->id ] ) ? sanitize_text_field( wp_unslash( $_POST['prev_style'][ $form->id ] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing
769 + if ( $new_style == $previous_style ) {
872 770 continue;
873 771 }
874 772
875 - $new_style = sanitize_text_field( wp_unslash( $_POST['style'][ $form->id ] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Missing
876 -
877 773 $form->options['custom_style'] = $new_style;
878 774 $wpdb->update( $wpdb->prefix . 'frm_forms', array( 'options' => maybe_serialize( $form->options ) ), array( 'id' => $form->id ) );
879 775 unset( $form );
880 776 }
@@ -883,28 +779,15 @@
883 779 /**
884 780 * Echo content for the Custom CSS page.
885 781 *
886 782 * @param string $message
887 - * @param array $extra_args An array of extra arguments.
888 - *
889 783 * @return void
890 784 */
891 - public static function custom_css( $message = '', $extra_args = array() ) {
892 - $id = $extra_args['id'] ?? 'frm_codemirror_box';
893 - $settings = self::enqueue_codemirror( $id, $extra_args['placeholder'] ?? '' );
894 - $id = $settings ? $id : 'frm_custom_css_box';
895 - $show_errors = $extra_args['show_errors'] ?? true;
896 - $custom_css = $extra_args['custom_css'] ?? self::get_custom_css();
897 - $heading = $extra_args['heading'] ?? __( 'You can add custom css here or in your theme style.css. Any CSS added here will be used anywhere the Formidable CSS is loaded.', 'formidable' ); // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
898 - $textarea_params = ! empty( $extra_args['textarea_params'] ) ? $extra_args['textarea_params'] : array(
899 - 'name' => 'frm_custom_css',
900 - 'id' => $id,
901 - );
785 + public static function custom_css( $message = '' ) {
786 + $settings = self::enqueue_codemirror();
787 + $id = $settings ? 'frm_codemirror_box' : 'frm_custom_css_box';
788 + $custom_css = self::get_custom_css();
902 789
903 - if ( $settings ) {
904 - $textarea_params['class'] = 'hide-if-js';
905 - }
906 -
907 790 include FrmAppHelper::plugin_path() . '/classes/views/styles/custom_css.php';
908 791 }
909 792
910 793 /**
@@ -911,33 +794,22 @@
911 794 * Get custom CSS code entered in the Custom CSS page.
912 795 *
913 796 * @since 6.0
914 797 *
915 - * @param array|null $single_style_settings The single style settings.
916 - *
917 798 * @return string
918 799 */
919 - public static function get_custom_css( $single_style_settings = null ) {
920 - if ( $single_style_settings ) {
921 - // If the single style settings are passed, return the custom CSS from the single style settings.
922 - if ( ! empty( $single_style_settings['single_style_custom_css'] ) && ! empty( $single_style_settings['enable_style_custom_css'] ) ) {
923 - return $single_style_settings['single_style_custom_css'];
924 - }
925 -
926 - return '';
927 - }
928 -
800 + public static function get_custom_css() {
929 801 $settings = FrmAppHelper::get_settings();
930 -
931 802 if ( is_string( $settings->custom_css ) ) {
932 803 return $settings->custom_css;
933 804 }
934 805
935 806 // If it does not exist, check the default style as a fallback.
936 - $frm_style = new FrmStyle();
937 - $style = $frm_style->get_default_style();
807 + $frm_style = new FrmStyle();
808 + $style = $frm_style->get_default_style();
809 + $custom_css = $style->post_content['custom_css'];
938 810
939 - return $style->post_content['custom_css'];
811 + return $custom_css;
940 812 }
941 813
942 814 /**
943 815 * Enqueue assets for codemirror, built into WordPress since 4.9.
@@ -944,14 +816,11 @@
944 816 * The Custom CSS page uses codemirror.
945 817 *
946 818 * @since 6.0 Previously this code was embedded in self::custom_css.
947 819 *
948 - * @param string $id The ID of the codemirror box.
949 - * @param string $placeholder The placeholder text for the codemirror box.
950 - *
951 820 * @return array|false
952 821 */
953 - private static function enqueue_codemirror( $id = 'frm_codemirror_box', $placeholder = '' ) {
822 + private static function enqueue_codemirror() {
954 823 if ( ! function_exists( 'wp_enqueue_code_editor' ) ) {
955 824 // The WordPress version is likely older than 4.9.
956 825 return false;
957 826 }
@@ -964,9 +833,8 @@
964 833 'tabSize' => 2,
965 834 // As the codemirror box only appears once you click into the Custom CSS tab, we need to auto-refresh.
966 835 // Otherwise the line numbers all end up with a 1px width causing overlap issues with the text in the content.
967 836 'autoRefresh' => true,
968 - 'placeholder' => $placeholder,
969 837 ),
970 838 )
971 839 );
972 840
@@ -973,11 +841,9 @@
973 841 if ( $settings ) {
974 842 wp_add_inline_script(
975 843 'code-editor',
976 844 sprintf(
977 - 'jQuery( function() { window.%s_wp_editor = wp.codeEditor.initialize( \'%s\', %s ); } );',
978 - $id,
979 - $id,
845 + 'jQuery( function() { wp.codeEditor.initialize( \'frm_codemirror_box\', %s ); } );',
980 846 wp_json_encode( $settings )
981 847 )
982 848 );
983 849 }
@@ -1029,14 +895,14 @@
1029 895 FrmAppHelper::permission_check( 'frm_change_settings' );
1030 896 check_ajax_referer( 'frm_ajax', 'nonce' );
1031 897
1032 898 $style_id = FrmAppHelper::get_post_param( 'style_id', '', 'absint' );
1033 -
1034 899 if ( ! $style_id ) {
1035 900 // A style ID is not sent when resetting on the edit page.
1036 901 // Instead of resetting the style, send the defaults back so the inputs can be updated with JavaScript.
1037 902 $frm_style = new FrmStyle();
1038 - echo json_encode( $frm_style->get_defaults() );
903 + $defaults = $frm_style->get_defaults();
904 + echo json_encode( $defaults );
1039 905 wp_die();
1040 906 }
1041 907
1042 908 $frm_style = new FrmStyle();
@@ -1089,9 +955,9 @@
1089 955 /**
1090 956 * @return void
1091 957 */
1092 958 public static function add_meta_boxes() {
1093 - // Setup meta boxes
959 + // setup meta boxes
1094 960 $meta_boxes = array(
1095 961 'general' => __( 'General', 'formidable' ),
1096 962 'form-title' => __( 'Form Title', 'formidable' ),
1097 963 'form-description' => __( 'Form Description', 'formidable' ),
@@ -1121,9 +987,8 @@
1121 987
1122 988 /**
1123 989 * @param array $atts
1124 990 * @param array $sec
1125 - *
1126 991 * @return void
1127 992 */
1128 993 public static function include_style_section( $atts, $sec ) {
1129 994 extract( $atts ); // phpcs:ignore WordPress.PHP.DontExtract
@@ -1194,10 +1059,9 @@
1194 1059 * @return void
1195 1060 */
1196 1061 public static function maybe_hide_sample_form_error_message() {
1197 1062 $referer = FrmAppHelper::get_server_value( 'HTTP_REFERER' );
1198 -
1199 - if ( str_contains( $referer, 'admin.php?page=formidable-styles' ) ) {
1063 + if ( false !== strpos( $referer, 'admin.php?page=formidable-styles' ) ) {
1200 1064 echo '#frm_broken_styles_warning { display: none; }';
1201 1065 }
1202 1066 }
1203 1067
@@ -1206,9 +1070,8 @@
1206 1070 *
1207 1071 * @since 4.11.03
1208 1072 *
1209 1073 * @param string $css CSS content.
1210 - *
1211 1074 * @return string
1212 1075 */
1213 1076 public static function replace_relative_url( $css ) {
1214 1077 $plugin_url = trailingslashit( FrmAppHelper::plugin_url() );
@@ -1231,27 +1094,22 @@
1231 1094 * Check if the Formidable styling should be loaded,
1232 1095 * then enqueue it for the footer
1233 1096 *
1234 1097 * @since 2.0
1235 - *
1236 - * @return void
1237 1098 */
1238 1099 public static function enqueue_style() {
1239 1100 global $frm_vars;
1240 1101
1241 - if ( ! empty( $frm_vars['css_loaded'] ) ) {
1102 + if ( isset( $frm_vars['css_loaded'] ) && $frm_vars['css_loaded'] ) {
1242 1103 // The CSS has already been loaded.
1243 1104 return;
1244 1105 }
1245 1106
1246 1107 $frm_settings = FrmAppHelper::get_settings();
1247 -
1248 - if ( $frm_settings->load_style === 'none' ) {
1249 - return;
1108 + if ( $frm_settings->load_style !== 'none' ) {
1109 + wp_enqueue_style( 'formidable' );
1110 + $frm_vars['css_loaded'] = true;
1250 1111 }
1251 -
1252 - wp_enqueue_style( 'formidable' );
1253 - $frm_vars['css_loaded'] = true;
1254 1112 }
1255 1113
1256 1114 /**
1257 1115 * Get the stylesheets for the form settings page
@@ -1259,9 +1117,11 @@
1259 1117 * @return array<WP_Post>
1260 1118 */
1261 1119 public static function get_style_opts() {
1262 1120 $frm_style = new FrmStyle();
1263 - return $frm_style->get_all();
1121 + $styles = $frm_style->get_all();
1122 +
1123 + return $styles;
1264 1124 }
1265 1125
1266 1126 /**
1267 1127 * Get the style post object for a target form.
@@ -1266,16 +1126,14 @@
1266 1126 /**
1267 1127 * Get the style post object for a target form.
1268 1128 *
1269 1129 * @param bool|object|string $form
1270 - *
1271 1130 * @return WP_Post|null
1272 1131 */
1273 1132 public static function get_form_style( $form = 'default' ) {
1274 1133 $style = FrmFormsHelper::get_form_style( $form );
1275 1134
1276 - // phpcs:ignore Universal.Operators.StrictComparisons
1277 - if ( ! $style || 1 == $style ) {
1135 + if ( empty( $style ) || 1 == $style ) {
1278 1136 $style = 'default';
1279 1137 }
1280 1138
1281 1139 $frm_style = new FrmStyle( $style );
@@ -1282,59 +1140,12 @@
1282 1140 return $frm_style->get_one();
1283 1141 }
1284 1142
1285 1143 /**
1286 - * Get the active style object for a field's form.
1287 - *
1288 - * @since 6.32
1289 - *
1290 - * @param array|int $field The 'field' array.
1291 - *
1292 - * @return object
1293 - */
1294 - public static function get_active_style( $field ) {
1295 - if ( ! is_array( $field ) ) {
1296 - return new stdClass();
1297 - }
1298 -
1299 - $form_id = $field['parent_form_id'] ?? $field['form_id'];
1300 -
1301 - if ( isset( self::$active_style[ $form_id ] ) ) {
1302 - return self::$active_style[ $form_id ];
1303 - }
1304 -
1305 - $active_style = self::get_form_style( $form_id );
1306 -
1307 - if ( ! is_object( $active_style ) ) {
1308 - $active_style = new stdClass();
1309 - }
1310 -
1311 - self::$active_style[ $form_id ] = $active_style;
1312 -
1313 - return self::$active_style[ $form_id ];
1314 - }
1315 -
1316 - /**
1317 - * Get the style setting key that stores the alignment for a field type.
1318 - *
1319 - * @since 6.32
1320 - *
1321 - * @param string $field_type
1322 - *
1323 - * @return string
1324 - */
1325 - public static function get_align_key_for_style_settings( $field_type ) {
1326 - return 'checkbox' === $field_type ? 'check_align' : 'radio_align';
1327 - }
1328 -
1329 - /**
1330 1144 * @param string $class
1331 1145 * @param string $style
1332 - *
1333 - * @return string
1334 1146 */
1335 1147 public static function get_form_style_class( $class, $style ) {
1336 - // phpcs:ignore Universal.Operators.StrictComparisons
1337 1148 if ( 1 == $style ) {
1338 1149 $style = 'default';
1339 1150 }
1340 1151
@@ -1350,17 +1161,13 @@
1350 1161 }
1351 1162
1352 1163 /**
1353 1164 * @since 3.0
1354 - *
1355 1165 * @param object $style
1356 1166 * @param string $class
1357 - *
1358 - * @return void
1359 1167 */
1360 1168 private static function maybe_add_rtl_class( $style, &$class ) {
1361 1169 $is_rtl = isset( $style->post_content['direction'] ) && 'rtl' === $style->post_content['direction'];
1362 -
1363 1170 if ( $is_rtl ) {
1364 1171 $class .= ' frm_rtl';
1365 1172 }
1366 1173 }
@@ -1365,28 +1172,17 @@
1365 1172 }
1366 1173 }
1367 1174
1368 1175 /**
1369 - * @param string $val Style setting key.
1370 - * @param int|string $form Form ID or 'default'.
1371 - *
1372 - * @return mixed
1176 + * @param string $val
1373 1177 */
1374 1178 public static function get_style_val( $val, $form = 'default' ) {
1375 1179 $style = self::get_form_style( $form );
1376 -
1377 1180 if ( $style && isset( $style->post_content[ $val ] ) ) {
1378 1181 return $style->post_content[ $val ];
1379 1182 }
1380 -
1381 - return null;
1382 1183 }
1383 1184
1384 - /**
1385 - * @param array $default_styles
1386 - *
1387 - * @return array
1388 - */
1389 1185 public static function show_entry_styles( $default_styles ) {
1390 1186 $frm_style = new FrmStyle( 'default' );
1391 1187 $style = $frm_style->get_one();
1392 1188
@@ -1395,15 +1191,13 @@
1395 1191 }
1396 1192
1397 1193 foreach ( $default_styles as $name => $val ) {
1398 1194 $setting = $name;
1399 -
1400 - if ( 'border_width' === $name ) {
1195 + if ( 'border_width' == $name ) {
1401 1196 $setting = 'field_border_width';
1402 - } elseif ( 'alt_bg_color' === $name ) {
1197 + } elseif ( 'alt_bg_color' == $name ) {
1403 1198 $setting = 'bg_color_active';
1404 1199 }
1405 -
1406 1200 $default_styles[ $name ] = $style->post_content[ $setting ];
1407 1201 unset( $name, $val );
1408 1202 }
1409 1203
@@ -1409,16 +1203,12 @@
1409 1203
1410 1204 return $default_styles;
1411 1205 }
1412 1206
1413 - /**
1414 - * @param string $important
1415 - * @param array $field
1416 - *
1417 - * @return string
1418 - */
1419 - public static function important_style( $important, $field ) {
1420 - return self::get_style_val( 'important_style', $field['form_id'] );
1207 + public static function &important_style( $important, $field ) {
1208 + $important = self::get_style_val( 'important_style', $field['form_id'] );
1209 +
1210 + return $important;
1421 1211 }
1422 1212
1423 1213 /**
1424 1214 * Duplicate of WordPress do_accordion_section function, it adds an additional svg icon support.
@@ -1424,18 +1214,14 @@
1424 1214 * Duplicate of WordPress do_accordion_section function, it adds an additional svg icon support.
1425 1215 *
1426 1216 * @since 6.8.3
1427 1217 *
1428 - * @param string|WP_Screen $screen Screen ID or screen object.
1429 - * @param string $context Meta box context.
1430 - * @param mixed $data_object Data object passed to callbacks.
1431 - *
1432 1218 * @return int
1433 1219 */
1434 - public static function do_accordion_sections( $screen, $context, $data_object ) { // phpcs:ignore SlevomatCodingStandard.Complexity.Cognitive.ComplexityTooHigh
1220 + public static function do_accordion_sections( $screen, $context, $data_object ) {
1435 1221 global $wp_meta_boxes;
1436 1222
1437 - // The symbol id from icons.svg
1223 + // the symbol id from icons.svg
1438 1224 $icon_ids = array(
1439 1225 'ranking-fields-style' => 'frm_chart_bar_icon',
1440 1226 'section-fields-style' => 'frm-form-title-style',
1441 1227 );
@@ -1441,9 +1227,9 @@
1441 1227 );
1442 1228
1443 1229 wp_enqueue_script( 'accordion' );
1444 1230
1445 - if ( ! $screen ) {
1231 + if ( empty( $screen ) ) {
1446 1232 $screen = get_current_screen();
1447 1233 } elseif ( is_string( $screen ) ) {
1448 1234 $screen = convert_to_screen( $screen );
1449 1235 }
@@ -1449,9 +1235,8 @@
1449 1235 }
1450 1236
1451 1237 $page = $screen->id;
1452 1238
1453 - // phpcs:disable Generic.WhiteSpace.ScopeIndent
1454 1239 ?>
1455 1240 <div id="side-sortables" class="accordion-container">
1456 1241 <ul class="outer-border">
1457 1242 <?php
@@ -1459,46 +1244,40 @@
1459 1244 $first_open = false;
1460 1245
1461 1246 if ( isset( $wp_meta_boxes[ $page ][ $context ] ) ) {
1462 1247 foreach ( array( 'high', 'core', 'default', 'low' ) as $priority ) {
1463 - if ( ! isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
1464 - continue;
1465 - }
1248 + if ( isset( $wp_meta_boxes[ $page ][ $context ][ $priority ] ) ) {
1249 + foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
1250 + if ( false === $box || ! $box['title'] ) {
1251 + continue;
1252 + }
1466 1253
1467 - foreach ( $wp_meta_boxes[ $page ][ $context ][ $priority ] as $box ) {
1468 - if ( false === $box || ! $box['title'] ) {
1469 - continue;
1470 - }
1254 + ++$i;
1255 + $icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[ $box['id'] ] : 'frm-' . $box['id'];
1471 1256
1472 - ++$i;
1473 - $icon_id = array_key_exists( $box['id'], $icon_ids ) ? $icon_ids[ $box['id'] ] : 'frm-' . $box['id'];
1474 - $open_class = '';
1475 -
1476 - if ( ! $first_open ) {
1477 - $first_open = true;
1478 - $open_class = 'open';
1479 - }
1480 -
1481 - $accordion_content_id = 'frm_style_section_' . $box['id'];
1482 - ?>
1483 - <li class="control-section accordion-section <?php echo esc_attr( $open_class ); ?> <?php echo esc_attr( $box['id'] ); ?>" id="<?php echo esc_attr( $box['id'] ); ?>"><?php // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ?>
1484 - <h3 class="accordion-section-title hndle">
1485 - <?php
1486 - FrmAppHelper::icon_by_class( 'frmfont ' . $icon_id . ' frm_svg24' );
1487 - echo esc_html( $box['title'] );
1488 - ?>
1489 - <button type="button" aria-expanded="<?php echo esc_attr( 'open' === $open_class ? 'true' : 'false' ); ?>" aria-controls="<?php echo esc_attr( $accordion_content_id ); ?>" aria-label="<?php echo esc_attr( $box['title'] ); ?>"><?php // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ?>
1490 - <?php FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon' ); ?>
1491 - </button>
1492 - </h3>
1493 - <div class="accordion-section-content <?php postbox_classes( $box['id'], $page ); ?>" id="<?php echo esc_attr( $accordion_content_id ); ?>">
1494 - <div class="inside">
1495 - <?php call_user_func( $box['callback'], $data_object, $box ); ?>
1496 - </div><!-- .inside -->
1497 - </div><!-- .accordion-section-content -->
1498 - </li><!-- .accordion-section -->
1499 - <?php
1500 - }//end foreach
1257 + $open_class = '';
1258 + if ( ! $first_open ) {
1259 + $first_open = true;
1260 + $open_class = 'open';
1261 + }
1262 + ?>
1263 + <li class="control-section accordion-section <?php echo esc_attr( $open_class ); ?> <?php echo esc_attr( $box['id'] ); ?>" id="<?php echo esc_attr( $box['id'] ); ?>">
1264 + <h3 class="accordion-section-title hndle" tabindex="0">
1265 + <?php
1266 + FrmAppHelper::icon_by_class( 'frmfont ' . $icon_id );
1267 + echo esc_html( $box['title'] );
1268 + FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon' );
1269 + ?>
1270 + </h3>
1271 + <div class="accordion-section-content <?php postbox_classes( $box['id'], $page ); ?>">
1272 + <div class="inside">
1273 + <?php call_user_func( $box['callback'], $data_object, $box ); ?>
1274 + </div><!-- .inside -->
1275 + </div><!-- .accordion-section-content -->
1276 + </li><!-- .accordion-section -->
1277 + <?php
1278 + }//end foreach
1279 + }//end if
1501 1280 }//end foreach
1502 1281 }//end if
1503 1282 ?>
1504 1283 </ul><!-- .outer-border -->
@@ -1503,9 +1282,8 @@
1503 1282 ?>
1504 1283 </ul><!-- .outer-border -->
1505 1284 </div><!-- .accordion-container -->
1506 1285 <?php
1507 - // phpcs:enable Generic.WhiteSpace.ScopeIndent
1508 1286 return $i;
1509 1287 }
1510 1288
1511 1289 /**
@@ -1516,9 +1294,8 @@
1516 1294 * @return void
1517 1295 */
1518 1296 public static function rename_style() {
1519 1297 $permission_error = FrmAppHelper::permission_nonce_error( 'frm_edit_forms', 'nonce', 'frm_ajax' );
1520 -
1521 1298 if ( $permission_error !== false ) {
1522 1299 $data = array(
1523 1300 'message' => __( 'Unable to rename style', 'formidable' ),
1524 1301 );
@@ -1537,9 +1314,8 @@
1537 1314 die();
1538 1315 }
1539 1316
1540 1317 $post = get_post( $style_id );
1541 -
1542 1318 if ( ! $post || $post->post_type !== self::$post_type ) {
1543 1319 $data = array(
1544 1320 'message' => __( 'The style you are renaming either does not exist or it is not a style', 'formidable' ),
1545 1321 );
@@ -1560,9 +1336,8 @@
1560 1336 *
1561 1337 * @since 6.0
1562 1338 *
1563 1339 * @param WP_Styles $styles
1564 - *
1565 1340 * @return void
1566 1341 */
1567 1342 public static function disable_conflicting_wp_admin_css( $styles ) {
1568 1343 if ( ! FrmAppHelper::is_style_editor_page() ) {