PluginProbe
Filter Everything — WordPress & WooCommerce Filters / 1.9.7
Filter Everything — WordPress & WooCommerce Filters v1.9.7
1.9.7 1.9.6 1.9.5 1.9.4 1.9.3 1.9.2.2 1.9.2.1 trunk 1.2.1 1.2.3 1.2.4 1.2.5 1.3.0 1.3.1 1.3.2 1.4.1 1.4.4 1.4.5 1.4.8 1.4.9 1.5.0 1.5.1 1.6.0 1.6.1 1.6.2 All 52 releases
← All changes | src/wpc-third-party.php +420 -32 1.9.2.21.9.7 View file →
@@ -44,9 +44,11 @@
44 44 add_action('woocommerce_no_products_found', 'flrt_filters_button', 5);
45 45 }else{
46 46 if (isset($theme_dependencies['button_hook']) && is_array($theme_dependencies['button_hook'])) {
47 47 foreach ($theme_dependencies['button_hook'] as $button_hook) {
48 - add_action($button_hook, 'flrt_filters_button', 15);
48 + add_action($button_hook, function() use ($button_hook) {
49 + flrt_filters_button(0, '', $button_hook);
50 + }, 15);
49 51 }
50 52 }
51 53 }
52 54
@@ -52,9 +54,11 @@
52 54
53 55 } else {
54 56 if (isset($theme_dependencies['button_hook']) && is_array($theme_dependencies['button_hook'])) {
55 57 foreach ($theme_dependencies['button_hook'] as $button_hook) {
56 - add_action($button_hook, 'flrt_filters_button', 15);
58 + add_action($button_hook, function() use ($button_hook) {
59 + flrt_filters_button(0, '', $button_hook);
60 + }, 15);
57 61 }
58 62 }
59 63 }
60 64 }
@@ -158,8 +162,15 @@
158 162 'primary_color' => '#0073aa',
159 163 'button_hook' => '',
160 164 'chips_hook' => ''
161 165 ),
166 + 'twentytwentyfive' => array(
167 + 'posts_container' => '#wp--skip-link--target',
168 + 'sidebar_container' => '',
169 + 'primary_color' => '#0073aa',
170 + 'button_hook' => '',
171 + 'chips_hook' => ''
172 + ),
162 173 'twentytwenty' => array(
163 174 'posts_container' => '#site-content',
164 175 'sidebar_container' => '',
165 176 'primary_color' => '#cd2653',
@@ -320,15 +331,8 @@
320 331 'primary_color' => '',
321 332 'button_hook' => '',
322 333 'chips_hook' => ''
323 334 ),
324 - 'divi' => array(
325 - 'posts_container' => '#primary',
326 - 'sidebar_container' => '#secondary',
327 - 'primary_color' => '',
328 - 'button_hook' => '',
329 - 'chips_hook' => ''
330 - ),
331 335 'woodmart' => array(
332 336 'posts_container' => '.site-content',
333 337 'sidebar_container' => '#secondary',
334 338 'primary_color' => '#83b735',
@@ -333,9 +337,24 @@
333 337 'sidebar_container' => '#secondary',
334 338 'primary_color' => '#83b735',
335 339 'button_hook' => '',
336 340 'chips_hook' => array( 'woodmart_shop_filters_area', 'woodmart_main_loop')
337 - )
341 + ),
342 +
343 + 'bricks' => array(
344 + 'posts_container' => '.brxe-container',
345 + 'sidebar_container' => '',
346 + 'primary_color' => '',
347 + 'button_hook' => array('bricks_after_header'),
348 + 'chips_hook' => ''
349 + ),
350 + 'bb-theme' => array(
351 + 'posts_container' => '#fl-main-content',
352 + 'sidebar_container' => '',
353 + 'primary_color' => '',
354 + 'button_hook' => array('fl_content_open'),
355 + 'chips_hook' => ''
356 + ),
338 357 );
339 358
340 359 $theme_dependencies = apply_filters( 'wpc_theme_dependencies', $theme_dependencies );
341 360
@@ -719,9 +738,34 @@
719 738 $next_page = intval( $current_page ) + 1;
720 739 $data_next_page = $module->get_wp_link_page( $next_page );
721 740 $rewrite = $wp_rewrite->wp_rewrite_rules();
722 741
723 - if ( defined('FLRT_PERMALINKS_ENABLED') && FLRT_PERMALINKS_ENABLED ) {
742 + /*
743 + * Loop widgets (Loop Grid/Loop Carousel) paginate with a widget-scoped
744 + * query arg (?e-page-<widget id>=N) instead of /page/N/, so the
745 + * path-based base replacement below never matches. Swap the base for
746 + * the filtered URL directly and carry the pagination args over.
747 + */
748 + $next_page_args = array();
749 + $next_url_parts = parse_url( $data_next_page );
750 + if ( isset( $next_url_parts['query'] ) ) {
751 + parse_str( $next_url_parts['query'], $next_page_args );
752 + }
753 +
754 + $e_page_args = array();
755 + foreach ( $next_page_args as $arg_key => $arg_value ) {
756 + if ( strpos( $arg_key, 'e-page-' ) === 0 ) {
757 + $e_page_args[ $arg_key ] = $arg_value;
758 + }
759 + }
760 +
761 + if ( ! empty( $e_page_args ) ) {
762 + // The current request may already contain pagination args (page 2+)
763 + $data_next_page = remove_query_arg( array_keys( $e_page_args ), $urlManager->getFormActionOrFullPageUrl( true ) );
764 + foreach ( $e_page_args as $arg_key => $arg_value ) {
765 + $data_next_page = flrt_add_query_arg( $arg_key, $arg_value, $data_next_page );
766 + }
767 + } else if ( defined('FLRT_PERMALINKS_ENABLED') && FLRT_PERMALINKS_ENABLED ) {
724 768 // This is ok when permalinks are enabled.
725 769 $data_next_page = str_replace( $urlManager->removePaginationBase( $data_next_page ), $urlManager->getFormActionOrFullPageUrl(), $data_next_page );
726 770 $uri_components = explode( "?", $urlManager->getFormActionOrFullPageUrl( true ) );
727 771 if( isset( $uri_components[1] ) ){
@@ -745,9 +789,27 @@
745 789 }
746 790 }
747 791 }
748 792
749 - $widget_content = preg_replace('%data-next-page\="[^"]+"%', 'data-next-page="' . $data_next_page . '"', $widget_content);
793 + /*
794 + * $data_next_page carries the GET part of the current request, and
795 + * getFormActionOrFullPageUrl() hands it back URL-DECODED (parse_str()
796 + * + build_query(), which does not re-encode). Printed raw, a request
797 + * like ?x="><script>… closed the attribute and injected markup —
798 + * reflected XSS, reported by Wordfence (CVE-2026-87869). esc_url()
799 + * drops the characters that can break out of the attribute and
800 + * re-encodes the ampersands for the HTML context.
801 + * A callback instead of a replacement string: in a string "$1" or
802 + * "\1" coming from the URL would be read as a backreference.
803 + */
804 + $next_page_attr = 'data-next-page="' . esc_url( $data_next_page ) . '"';
805 + $widget_content = preg_replace_callback(
806 + '%data-next-page\="[^"]+"%',
807 + function () use ( $next_page_attr ) {
808 + return $next_page_attr;
809 + },
810 + $widget_content
811 + );
750 812 }
751 813
752 814 return $widget_content;
753 815 }
@@ -813,11 +875,11 @@
813 875 add_action( 'elementor/elements/categories_registered', 'wpc_add_elementor_widget_categories' );
814 876
815 877 function wpc_register_elementor_widget( $widgets_manager ) {
816 878
817 - flrt_include('src/Admin/Widgets/ElementorWidgets/ChipsElementorWidget.php');
818 - flrt_include('src/Admin/Widgets/ElementorWidgets/FiltersElementorWidget.php');
819 - flrt_include('src/Admin/Widgets/ElementorWidgets/SortingElementorWidget.php');
879 + flrt_include('src/Frontend/Builders/ElementorWidgets/ChipsElementorWidget.php');
880 + flrt_include('src/Frontend/Builders/ElementorWidgets/FiltersElementorWidget.php');
881 + flrt_include('src/Frontend/Builders/ElementorWidgets/SortingElementorWidget.php');
820 882
821 883 $widgets_manager->register( new \FilterEverything\Filter\ChipsElementorWidget() );
822 884 $widgets_manager->register( new \FilterEverything\Filter\FiltersElementorWidget() );
823 885 $widgets_manager->register( new \FilterEverything\Filter\SortingElementorWidget() );
@@ -831,9 +893,9 @@
831 893 FLRT_PLUGIN_DIR_URL . 'assets/css/elementor-icon.css'
832 894 );
833 895 $css = '
834 896 .wpc-fe-icon {
835 - background: url(%s) no-repeat;
897 + background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2ZXJzaW9uPSIxLjEiIGVuYWJsZS1iYWNrZ3JvdW5kPSJuZXcgMCAwIDUzIDUzIiBpZD0iTGF5ZXJfMSIgeD0iMHB4IiB5PSIwcHgiIHZpZXdCb3g9IjAgMCA1MyA1MyIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNTMgNTM7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCiAgICAgICAgICAgICAgIDxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+DQogICAgICAgICAgICAgICAgLnN0MHtkaXNwbGF5Om5vbmU7fQ0KICAgICAgICAgICAgICAgIC5zdDF7ZGlzcGxheTppbmxpbmU7fQ0KICAgICAgICAgICAgICAgIC5zdDN7ZmlsbDojZmZmZmZmO30NCiAgICAgIC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CwwLjgtMC4zLDAuOC0wLjhzLTAuMy0wLjgtMC44LTAuOGgtMTBDMzMuMywyMC4yLDMzLjMsMjAuMiwzMy4zLDIxeiIvPg0KICAgICAgICAgICAgICAgPC9nPg0KICAgICAgICAgICAgICAgDQogICAgICAgICAgICAgICA8Y2lyY2xlIGNsYXNzPSJzdDYiIGZpbGwtb3BhY2l0eT0iMCIgY3g9IjIzLjMiIGN5PSIyMC4xIiByPSIyLjUiLz4NCiAgICAgICAgICAgICAgIDxjaXJjbGUgY2xhc3M9InN0NiIgZmlsbC1vcGFjaXR5PSIwIiBjeD0iMzMuMiIgY3k9IjI0LjgiIHI9IjIuNSIvPg0KICAgICAgICAgICAgICAgPGNpcmNsZSBjbGFzcz0ic3Q2IiBmaWxsLW9wYWNpdHk9IjAiIGN4PSIyMyIgY3k9IjM0LjgiIHI9IjIuNSIvPg0KICAgICAgICAgICAgICAgPC9zdmc+) no-repeat;
836 898 background-size: auto;
837 899 background-size: contain;
838 900 display: inline-block;
839 901 width: 28px;
@@ -838,9 +900,9 @@
838 900 display: inline-block;
839 901 width: 28px;
840 902 height: 28px;
841 903 margin-bottom: -5px;
842 - }
904 + }
843 905
844 906 .elementor-navigator__element-widget .wpc-fe-icon {
845 907 width: 15px;
846 908 height: 15px;
@@ -845,9 +907,9 @@
845 907 width: 15px;
846 908 height: 15px;
847 909 margin-bottom: 0px;
848 910 }';
849 - wp_add_inline_style( 'filter-everything-elementor', sprintf( $css, esc_attr(flrt_get_icon_svg()) ) );
911 + wp_add_inline_style( 'filter-everything-elementor', $css );
850 912 });
851 913
852 914 add_filter('elementor/document/wrapper_attributes', function($attributes) {
853 915 $attributes['wpc-filter-elementor-widget'] = true;
@@ -890,22 +952,22 @@
890 952 wp_enqueue_style($handle);
891 953
892 954
893 955 $css = <<<PHP_CSS
894 -#toplevel_page_edit-post_type-filter-set .wp-menu-image{
895 - content: '';
896 - background-repeat: no-repeat;
897 - background-position: center;
898 - background-size: 20px;
899 - background-image: url('data:image/svg+xml,%3C%3Fxml version="1.0" encoding="utf-8"%3F%3E%3C!-- --%3E%3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 53 53" style="enable-background:new 0 0 53 53;" xml:space="preserve"%3E%3Cstyle type="text/css"%3E .st0%7Bdisplay:none;%7D .st1%7Bdisplay:inline;%7D .st2%7Bclip-path:url(%23SVGID_00000142154616827085436530000012698217856111301567_);%7D .st3%7Bfill:%23a7aaad;%7D .st4%7Bdisplay:none;fill:%23FFFFFF;%7D .st5%7Bfill:none;stroke:%23a7aaad;stroke-width:3;stroke-miterlimit:10;%7D .st6%7Bfill:none;stroke:%23a7aaad;stroke-width:2;stroke-miterlimit:10;%7D%0A%3C/style%3E%3Cg id="Layer_2_00000047770719710110742230000003923951626148849557_" class="st0"%3E%3Crect class="st1" width="53.1" height="53.1"/%3E%3C/g%3E%3Cg id="Layer_1_00000162333103265806981530000017146624247591674556_"%3E%3Cg%3E%3Cg%3E%3Cdefs%3E%3Cpath id="SVGID_1_" d="M0,0h53v53H0V0z M23.3,37.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5 C20.8,36.1,21.9,37.2,23.3,37.2z M33.4,27.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5S32,27.2,33.4,27.2z M23,22.8c1.6,0,2.9-1.3,2.9-2.9S24.6,17,23,17s-2.9,1.3-2.9,2.9C20.2,21.5,21.5,22.8,23,22.8z"/%3E%3C/defs%3E%3CclipPath id="SVGID_00000111880200341027563210000003406718579453459379_"%3E%3Cuse xlink:href="%23SVGID_1_" style="overflow:visible;"/%3E%3C/clipPath%3E%3Cg id="BarsClipped" style="clip-path:url(%23SVGID_00000111880200341027563210000003406718579453459379_);"%3E%3Cpath class="st3" d="M39.9,31.5L18,37.3c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C40.8,30.7,40.5,31.3,39.9,31.5z"/%3E%3Cpath class="st3" d="M38.1,24.6l-21.9,5.9c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C39,23.8,38.7,24.5,38.1,24.6z"/%3E%3Cpath class="st3" d="M36.2,17.9l-21.9,5.9c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C37.2,17.1,36.8,17.7,36.2,17.9z"/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cpath class="st4" d="M23.3,37.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5C20.8,36.1,21.9,37.2,23.3,37.2z"/%3E%3Cpath class="st4" d="M33.4,27.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5S32,27.2,33.4,27.2z"/%3E%3Cpath class="st4" d="M23,22.8c1.6,0,2.9-1.3,2.9-2.9S24.6,17,23,17s-2.9,1.3-2.9,2.9C20.2,21.5,21.5,22.8,23,22.8z"/%3E%3Cpath class="st4" d="M23.9,38.2c-1.9,0.5-3.8-0.6-4.3-2.5c-0.5-1.9,0.6-3.8,2.5-4.3s3.8,0.6,4.3,2.5C26.9,35.8,25.8,37.7,23.9,38.2 z M22.6,33.2c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C24.3,33.5,23.4,33,22.6,33.2z"/%3E%3Cpath class="st4" d="M34.1,28.2c-1.9,0.5-3.8-0.6-4.3-2.5s0.6-3.8,2.5-4.3c1.9-0.5,3.8,0.6,4.3,2.5C37.1,25.8,36,27.7,34.1,28.2z M32.8,23.2c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C34.5,23.5,33.6,23,32.8,23.2z"/%3E%3Cpath class="st4" d="M24.2,23.5c-1.9,0.5-3.8-0.6-4.3-2.5s0.6-3.8,2.5-4.3s3.8,0.6,4.3,2.5S26.1,23,24.2,23.5z M22.9,18.6 c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C24.7,18.8,23.8,18.3,22.9,18.6z"/%3E%3Cpath class="st5" d="M26.5,51.5c13.8,0,25-11.2,25-25s-11.2-25-25-25s-25,11.2-25,25S12.7,51.5,26.5,51.5z"/%3E%3Cpath class="st4" d="M33.3,21h10c0.4,0,0.8-0.3,0.8-0.8s-0.3-0.8-0.8-0.8h-10C33.3,20.2,33.3,20.2,33.3,21z"/%3E%3C/g%3E%3Ccircle class="st6" cx="23.3" cy="20.1" r="2.5"/%3E%3Ccircle class="st6" cx="33.2" cy="24.8" r="2.5"/%3E%3Ccircle class="st6" cx="23" cy="34.8" r="2.5"/%3E%3C/svg%3E');
900 -}
901 -#toplevel_page_edit-post_type-filter-set:hover .wp-menu-image{
902 - background-image: url('data:image/svg+xml,%3C%3Fxml version="1.0" encoding="utf-8"%3F%3E%3C!-- --%3E%3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 53 53" style="enable-background:new 0 0 53 53;" xml:space="preserve"%3E%3Cstyle type="text/css"%3E .st0%7Bdisplay:none;%7D .st1%7Bdisplay:inline;%7D .st2%7Bclip-path:url(%23SVGID_00000142154616827085436530000012698217856111301567_);%7D .st3%7Bfill:%2372AEE6;%7D .st4%7Bdisplay:none;fill:%23FFFFFF;%7D .st5%7Bfill:none;stroke:%2372AEE6;stroke-width:3;stroke-miterlimit:10;%7D .st6%7Bfill:none;stroke:%2372AEE6;stroke-width:2;stroke-miterlimit:10;%7D%0A%3C/style%3E%3Cg id="Layer_2_00000047770719710110742230000003923951626148849557_" class="st0"%3E%3Crect class="st1" width="53.1" height="53.1"/%3E%3C/g%3E%3Cg id="Layer_1_00000162333103265806981530000017146624247591674556_"%3E%3Cg%3E%3Cg%3E%3Cdefs%3E%3Cpath id="SVGID_1_" d="M0,0h53v53H0V0z M23.3,37.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5 C20.8,36.1,21.9,37.2,23.3,37.2z M33.4,27.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5S32,27.2,33.4,27.2z M23,22.8c1.6,0,2.9-1.3,2.9-2.9S24.6,17,23,17s-2.9,1.3-2.9,2.9C20.2,21.5,21.5,22.8,23,22.8z"/%3E%3C/defs%3E%3CclipPath id="SVGID_00000111880200341027563210000003406718579453459379_"%3E%3Cuse xlink:href="%23SVGID_1_" style="overflow:visible;"/%3E%3C/clipPath%3E%3Cg id="BarsClipped" style="clip-path:url(%23SVGID_00000111880200341027563210000003406718579453459379_);"%3E%3Cpath class="st3" d="M39.9,31.5L18,37.3c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C40.8,30.7,40.5,31.3,39.9,31.5z"/%3E%3Cpath class="st3" d="M38.1,24.6l-21.9,5.9c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C39,23.8,38.7,24.5,38.1,24.6z"/%3E%3Cpath class="st3" d="M36.2,17.9l-21.9,5.9c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C37.2,17.1,36.8,17.7,36.2,17.9z"/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cpath class="st4" d="M23.3,37.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5C20.8,36.1,21.9,37.2,23.3,37.2z"/%3E%3Cpath class="st4" d="M33.4,27.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5S32,27.2,33.4,27.2z"/%3E%3Cpath class="st4" d="M23,22.8c1.6,0,2.9-1.3,2.9-2.9S24.6,17,23,17s-2.9,1.3-2.9,2.9C20.2,21.5,21.5,22.8,23,22.8z"/%3E%3Cpath class="st4" d="M23.9,38.2c-1.9,0.5-3.8-0.6-4.3-2.5c-0.5-1.9,0.6-3.8,2.5-4.3s3.8,0.6,4.3,2.5C26.9,35.8,25.8,37.7,23.9,38.2 z M22.6,33.2c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C24.3,33.5,23.4,33,22.6,33.2z"/%3E%3Cpath class="st4" d="M34.1,28.2c-1.9,0.5-3.8-0.6-4.3-2.5s0.6-3.8,2.5-4.3c1.9-0.5,3.8,0.6,4.3,2.5C37.1,25.8,36,27.7,34.1,28.2z M32.8,23.2c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C34.5,23.5,33.6,23,32.8,23.2z"/%3E%3Cpath class="st4" d="M24.2,23.5c-1.9,0.5-3.8-0.6-4.3-2.5s0.6-3.8,2.5-4.3s3.8,0.6,4.3,2.5S26.1,23,24.2,23.5z M22.9,18.6 c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C24.7,18.8,23.8,18.3,22.9,18.6z"/%3E%3Cpath class="st5" d="M26.5,51.5c13.8,0,25-11.2,25-25s-11.2-25-25-25s-25,11.2-25,25S12.7,51.5,26.5,51.5z"/%3E%3Cpath class="st4" d="M33.3,21h10c0.4,0,0.8-0.3,0.8-0.8s-0.3-0.8-0.8-0.8h-10C33.3,20.2,33.3,20.2,33.3,21z"/%3E%3C/g%3E%3Ccircle class="st6" cx="23.3" cy="20.1" r="2.5"/%3E%3Ccircle class="st6" cx="33.2" cy="24.8" r="2.5"/%3E%3Ccircle class="st6" cx="23" cy="34.8" r="2.5"/%3E%3C/svg%3E');
903 -}
904 -.wp-menu-open#toplevel_page_edit-post_type-filter-set .wp-menu-image {
905 - background-image: url('data:image/svg+xml,%3C%3Fxml version="1.0" encoding="utf-8"%3F%3E%3C!-- --%3E%3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 53 53" style="enable-background:new 0 0 53 53;" xml:space="preserve"%3E%3Cstyle type="text/css"%3E .st0%7Bdisplay:none;%7D .st1%7Bdisplay:inline;%7D .st2%7Bclip-path:url(%23SVGID_00000098199702249043298830000017010845528166695064_);%7D .st3%7Bfill:%23FFFFFF;%7D .st4%7Bdisplay:none;fill:%23FFFFFF;%7D .st5%7Bfill:none;stroke:%23FFFFFF;stroke-width:3;stroke-miterlimit:10;%7D .st6%7Bfill:none;stroke:%23FFFFFF;stroke-width:2;stroke-miterlimit:10;%7D%0A%3C/style%3E%3Cg id="Layer_2_00000047770719710110742230000003923951626148849557_" class="st0"%3E%3Crect x="0" y="0" class="st1" width="53.1" height="53.1"/%3E%3C/g%3E%3Cg id="Layer_1_00000162333103265806981530000017146624247591674556_"%3E%3Cg%3E%3Cdefs%3E%3Cpath id="SVGID_1_" d="M0,0h53v53H0V0z M23.3,37.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5 C20.8,36.1,21.9,37.2,23.3,37.2z M33.4,27.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5S32,27.2,33.4,27.2z M23,22.8c1.6,0,2.9-1.3,2.9-2.9S24.6,17,23,17s-2.9,1.3-2.9,2.9C20.2,21.5,21.5,22.8,23,22.8z"/%3E%3C/defs%3E%3CclipPath id="SVGID_00000112608340804245442460000013986219178199086244_"%3E%3Cuse xlink:href="%23SVGID_1_" style="overflow:visible;"/%3E%3C/clipPath%3E%3Cg id="BarsClipped" style="clip-path:url(%23SVGID_00000112608340804245442460000013986219178199086244_);"%3E%3Cpath class="st3" d="M39.9,31.5L18,37.3c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C40.8,30.7,40.5,31.3,39.9,31.5z"/%3E%3Cpath class="st3" d="M38.1,24.6l-21.9,5.9c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C39,23.8,38.7,24.5,38.1,24.6z"/%3E%3Cpath class="st3" d="M36.2,17.9l-21.9,5.9c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C37.2,17.1,36.8,17.7,36.2,17.9z"/%3E%3C/g%3E%3C/g%3E%3Cpath class="st4" d="M23.3,37.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5C20.8,36.1,21.9,37.2,23.3,37.2z"/%3E%3Cpath class="st4" d="M33.4,27.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5S32,27.2,33.4,27.2z"/%3E%3Cpath class="st4" d="M23,22.8c1.6,0,2.9-1.3,2.9-2.9S24.6,17,23,17s-2.9,1.3-2.9,2.9C20.2,21.5,21.5,22.8,23,22.8z"/%3E%3Cpath class="st4" d="M23.9,38.2c-1.9,0.5-3.8-0.6-4.3-2.5c-0.5-1.9,0.6-3.8,2.5-4.3s3.8,0.6,4.3,2.5C26.9,35.8,25.8,37.7,23.9,38.2 z M22.6,33.2c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C24.3,33.5,23.4,33,22.6,33.2z"/%3E%3Cpath class="st4" d="M34.1,28.2c-1.9,0.5-3.8-0.6-4.3-2.5s0.6-3.8,2.5-4.3c1.9-0.5,3.8,0.6,4.3,2.5C37.1,25.8,36,27.7,34.1,28.2z M32.8,23.2c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C34.5,23.5,33.6,23,32.8,23.2z"/%3E%3Cpath class="st4" d="M24.2,23.5c-1.9,0.5-3.8-0.6-4.3-2.5s0.6-3.8,2.5-4.3s3.8,0.6,4.3,2.5S26.1,23,24.2,23.5z M22.9,18.6 c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C24.7,18.8,23.8,18.3,22.9,18.6z"/%3E%3Cpath class="st5" d="M26.5,51.5c13.8,0,25-11.2,25-25s-11.2-25-25-25s-25,11.2-25,25S12.7,51.5,26.5,51.5z"/%3E%3Cpath class="st4" d="M33.3,21h10c0.4,0,0.8-0.3,0.8-0.8s-0.3-0.8-0.8-0.8h-10C33.3,20.2,33.3,20.2,33.3,21z"/%3E%3C/g%3E%3Ccircle class="st6" cx="23.3" cy="20.1" r="2.5"/%3E%3Ccircle class="st6" cx="33.2" cy="24.8" r="2.5"/%3E%3Ccircle class="st6" cx="23" cy="34.8" r="2.5"/%3E%3C/svg%3E');
906 -}
907 -PHP_CSS;
956 + #toplevel_page_edit-post_type-filter-set .wp-menu-image{
957 + content: '';
958 + background-repeat: no-repeat;
959 + background-position: center;
960 + background-size: 20px;
961 + background-image: url('data:image/svg+xml,%3C%3Fxml version="1.0" encoding="utf-8"%3F%3E%3C!-- --%3E%3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 53 53" style="enable-background:new 0 0 53 53;" xml:space="preserve"%3E%3Cstyle type="text/css"%3E .st0%7Bdisplay:none;%7D .st1%7Bdisplay:inline;%7D .st2%7Bclip-path:url(%23SVGID_00000142154616827085436530000012698217856111301567_);%7D .st3%7Bfill:%23a7aaad;%7D .st4%7Bdisplay:none;fill:%23FFFFFF;%7D .st5%7Bfill:none;stroke:%23a7aaad;stroke-width:3;stroke-miterlimit:10;%7D .st6%7Bfill:none;stroke:%23a7aaad;stroke-width:2;stroke-miterlimit:10;%7D%0A%3C/style%3E%3Cg id="Layer_2_00000047770719710110742230000003923951626148849557_" class="st0"%3E%3Crect class="st1" width="53.1" height="53.1"/%3E%3C/g%3E%3Cg id="Layer_1_00000162333103265806981530000017146624247591674556_"%3E%3Cg%3E%3Cg%3E%3Cdefs%3E%3Cpath id="SVGID_1_" d="M0,0h53v53H0V0z M23.3,37.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5 C20.8,36.1,21.9,37.2,23.3,37.2z M33.4,27.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5S32,27.2,33.4,27.2z M23,22.8c1.6,0,2.9-1.3,2.9-2.9S24.6,17,23,17s-2.9,1.3-2.9,2.9C20.2,21.5,21.5,22.8,23,22.8z"/%3E%3C/defs%3E%3CclipPath id="SVGID_00000111880200341027563210000003406718579453459379_"%3E%3Cuse xlink:href="%23SVGID_1_" style="overflow:visible;"/%3E%3C/clipPath%3E%3Cg id="BarsClipped" style="clip-path:url(%23SVGID_00000111880200341027563210000003406718579453459379_);"%3E%3Cpath class="st3" d="M39.9,31.5L18,37.3c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C40.8,30.7,40.5,31.3,39.9,31.5z"/%3E%3Cpath class="st3" d="M38.1,24.6l-21.9,5.9c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C39,23.8,38.7,24.5,38.1,24.6z"/%3E%3Cpath class="st3" d="M36.2,17.9l-21.9,5.9c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C37.2,17.1,36.8,17.7,36.2,17.9z"/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cpath class="st4" d="M23.3,37.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5C20.8,36.1,21.9,37.2,23.3,37.2z"/%3E%3Cpath class="st4" d="M33.4,27.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5S32,27.2,33.4,27.2z"/%3E%3Cpath class="st4" d="M23,22.8c1.6,0,2.9-1.3,2.9-2.9S24.6,17,23,17s-2.9,1.3-2.9,2.9C20.2,21.5,21.5,22.8,23,22.8z"/%3E%3Cpath class="st4" d="M23.9,38.2c-1.9,0.5-3.8-0.6-4.3-2.5c-0.5-1.9,0.6-3.8,2.5-4.3s3.8,0.6,4.3,2.5C26.9,35.8,25.8,37.7,23.9,38.2 z M22.6,33.2c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C24.3,33.5,23.4,33,22.6,33.2z"/%3E%3Cpath class="st4" d="M34.1,28.2c-1.9,0.5-3.8-0.6-4.3-2.5s0.6-3.8,2.5-4.3c1.9-0.5,3.8,0.6,4.3,2.5C37.1,25.8,36,27.7,34.1,28.2z M32.8,23.2c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C34.5,23.5,33.6,23,32.8,23.2z"/%3E%3Cpath class="st4" d="M24.2,23.5c-1.9,0.5-3.8-0.6-4.3-2.5s0.6-3.8,2.5-4.3s3.8,0.6,4.3,2.5S26.1,23,24.2,23.5z M22.9,18.6 c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C24.7,18.8,23.8,18.3,22.9,18.6z"/%3E%3Cpath class="st5" d="M26.5,51.5c13.8,0,25-11.2,25-25s-11.2-25-25-25s-25,11.2-25,25S12.7,51.5,26.5,51.5z"/%3E%3Cpath class="st4" d="M33.3,21h10c0.4,0,0.8-0.3,0.8-0.8s-0.3-0.8-0.8-0.8h-10C33.3,20.2,33.3,20.2,33.3,21z"/%3E%3C/g%3E%3Ccircle class="st6" cx="23.3" cy="20.1" r="2.5"/%3E%3Ccircle class="st6" cx="33.2" cy="24.8" r="2.5"/%3E%3Ccircle class="st6" cx="23" cy="34.8" r="2.5"/%3E%3C/svg%3E');
962 + }
963 + #toplevel_page_edit-post_type-filter-set:hover .wp-menu-image{
964 + background-image: url('data:image/svg+xml,%3C%3Fxml version="1.0" encoding="utf-8"%3F%3E%3C!-- --%3E%3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 53 53" style="enable-background:new 0 0 53 53;" xml:space="preserve"%3E%3Cstyle type="text/css"%3E .st0%7Bdisplay:none;%7D .st1%7Bdisplay:inline;%7D .st2%7Bclip-path:url(%23SVGID_00000142154616827085436530000012698217856111301567_);%7D .st3%7Bfill:%2372AEE6;%7D .st4%7Bdisplay:none;fill:%23FFFFFF;%7D .st5%7Bfill:none;stroke:%2372AEE6;stroke-width:3;stroke-miterlimit:10;%7D .st6%7Bfill:none;stroke:%2372AEE6;stroke-width:2;stroke-miterlimit:10;%7D%0A%3C/style%3E%3Cg id="Layer_2_00000047770719710110742230000003923951626148849557_" class="st0"%3E%3Crect class="st1" width="53.1" height="53.1"/%3E%3C/g%3E%3Cg id="Layer_1_00000162333103265806981530000017146624247591674556_"%3E%3Cg%3E%3Cg%3E%3Cdefs%3E%3Cpath id="SVGID_1_" d="M0,0h53v53H0V0z M23.3,37.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5 C20.8,36.1,21.9,37.2,23.3,37.2z M33.4,27.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5S32,27.2,33.4,27.2z M23,22.8c1.6,0,2.9-1.3,2.9-2.9S24.6,17,23,17s-2.9,1.3-2.9,2.9C20.2,21.5,21.5,22.8,23,22.8z"/%3E%3C/defs%3E%3CclipPath id="SVGID_00000111880200341027563210000003406718579453459379_"%3E%3Cuse xlink:href="%23SVGID_1_" style="overflow:visible;"/%3E%3C/clipPath%3E%3Cg id="BarsClipped" style="clip-path:url(%23SVGID_00000111880200341027563210000003406718579453459379_);"%3E%3Cpath class="st3" d="M39.9,31.5L18,37.3c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C40.8,30.7,40.5,31.3,39.9,31.5z"/%3E%3Cpath class="st3" d="M38.1,24.6l-21.9,5.9c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C39,23.8,38.7,24.5,38.1,24.6z"/%3E%3Cpath class="st3" d="M36.2,17.9l-21.9,5.9c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C37.2,17.1,36.8,17.7,36.2,17.9z"/%3E%3C/g%3E%3C/g%3E%3C/g%3E%3Cpath class="st4" d="M23.3,37.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5C20.8,36.1,21.9,37.2,23.3,37.2z"/%3E%3Cpath class="st4" d="M33.4,27.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5S32,27.2,33.4,27.2z"/%3E%3Cpath class="st4" d="M23,22.8c1.6,0,2.9-1.3,2.9-2.9S24.6,17,23,17s-2.9,1.3-2.9,2.9C20.2,21.5,21.5,22.8,23,22.8z"/%3E%3Cpath class="st4" d="M23.9,38.2c-1.9,0.5-3.8-0.6-4.3-2.5c-0.5-1.9,0.6-3.8,2.5-4.3s3.8,0.6,4.3,2.5C26.9,35.8,25.8,37.7,23.9,38.2 z M22.6,33.2c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C24.3,33.5,23.4,33,22.6,33.2z"/%3E%3Cpath class="st4" d="M34.1,28.2c-1.9,0.5-3.8-0.6-4.3-2.5s0.6-3.8,2.5-4.3c1.9-0.5,3.8,0.6,4.3,2.5C37.1,25.8,36,27.7,34.1,28.2z M32.8,23.2c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C34.5,23.5,33.6,23,32.8,23.2z"/%3E%3Cpath class="st4" d="M24.2,23.5c-1.9,0.5-3.8-0.6-4.3-2.5s0.6-3.8,2.5-4.3s3.8,0.6,4.3,2.5S26.1,23,24.2,23.5z M22.9,18.6 c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C24.7,18.8,23.8,18.3,22.9,18.6z"/%3E%3Cpath class="st5" d="M26.5,51.5c13.8,0,25-11.2,25-25s-11.2-25-25-25s-25,11.2-25,25S12.7,51.5,26.5,51.5z"/%3E%3Cpath class="st4" d="M33.3,21h10c0.4,0,0.8-0.3,0.8-0.8s-0.3-0.8-0.8-0.8h-10C33.3,20.2,33.3,20.2,33.3,21z"/%3E%3C/g%3E%3Ccircle class="st6" cx="23.3" cy="20.1" r="2.5"/%3E%3Ccircle class="st6" cx="33.2" cy="24.8" r="2.5"/%3E%3Ccircle class="st6" cx="23" cy="34.8" r="2.5"/%3E%3C/svg%3E');
965 + }
966 + .wp-menu-open#toplevel_page_edit-post_type-filter-set .wp-menu-image {
967 + background-image: url('data:image/svg+xml,%3C%3Fxml version="1.0" encoding="utf-8"%3F%3E%3C!-- --%3E%3Csvg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 53 53" style="enable-background:new 0 0 53 53;" xml:space="preserve"%3E%3Cstyle type="text/css"%3E .st0%7Bdisplay:none;%7D .st1%7Bdisplay:inline;%7D .st2%7Bclip-path:url(%23SVGID_00000098199702249043298830000017010845528166695064_);%7D .st3%7Bfill:%23FFFFFF;%7D .st4%7Bdisplay:none;fill:%23FFFFFF;%7D .st5%7Bfill:none;stroke:%23FFFFFF;stroke-width:3;stroke-miterlimit:10;%7D .st6%7Bfill:none;stroke:%23FFFFFF;stroke-width:2;stroke-miterlimit:10;%7D%0A%3C/style%3E%3Cg id="Layer_2_00000047770719710110742230000003923951626148849557_" class="st0"%3E%3Crect x="0" y="0" class="st1" width="53.1" height="53.1"/%3E%3C/g%3E%3Cg id="Layer_1_00000162333103265806981530000017146624247591674556_"%3E%3Cg%3E%3Cdefs%3E%3Cpath id="SVGID_1_" d="M0,0h53v53H0V0z M23.3,37.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5 C20.8,36.1,21.9,37.2,23.3,37.2z M33.4,27.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5S32,27.2,33.4,27.2z M23,22.8c1.6,0,2.9-1.3,2.9-2.9S24.6,17,23,17s-2.9,1.3-2.9,2.9C20.2,21.5,21.5,22.8,23,22.8z"/%3E%3C/defs%3E%3CclipPath id="SVGID_00000112608340804245442460000013986219178199086244_"%3E%3Cuse xlink:href="%23SVGID_1_" style="overflow:visible;"/%3E%3C/clipPath%3E%3Cg id="BarsClipped" style="clip-path:url(%23SVGID_00000112608340804245442460000013986219178199086244_);"%3E%3Cpath class="st3" d="M39.9,31.5L18,37.3c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C40.8,30.7,40.5,31.3,39.9,31.5z"/%3E%3Cpath class="st3" d="M38.1,24.6l-21.9,5.9c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C39,23.8,38.7,24.5,38.1,24.6z"/%3E%3Cpath class="st3" d="M36.2,17.9l-21.9,5.9c-0.6,0.2-1.2-0.2-1.4-0.8c-0.2-0.6,0.2-1.2,0.8-1.4l21.9-5.9c0.6-0.2,1.2,0.2,1.4,0.8 C37.2,17.1,36.8,17.7,36.2,17.9z"/%3E%3C/g%3E%3C/g%3E%3Cpath class="st4" d="M23.3,37.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5C20.8,36.1,21.9,37.2,23.3,37.2z"/%3E%3Cpath class="st4" d="M33.4,27.2c1.4,0,2.5-1.1,2.5-2.5s-1.1-2.5-2.5-2.5s-2.5,1.1-2.5,2.5S32,27.2,33.4,27.2z"/%3E%3Cpath class="st4" d="M23,22.8c1.6,0,2.9-1.3,2.9-2.9S24.6,17,23,17s-2.9,1.3-2.9,2.9C20.2,21.5,21.5,22.8,23,22.8z"/%3E%3Cpath class="st4" d="M23.9,38.2c-1.9,0.5-3.8-0.6-4.3-2.5c-0.5-1.9,0.6-3.8,2.5-4.3s3.8,0.6,4.3,2.5C26.9,35.8,25.8,37.7,23.9,38.2 z M22.6,33.2c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C24.3,33.5,23.4,33,22.6,33.2z"/%3E%3Cpath class="st4" d="M34.1,28.2c-1.9,0.5-3.8-0.6-4.3-2.5s0.6-3.8,2.5-4.3c1.9-0.5,3.8,0.6,4.3,2.5C37.1,25.8,36,27.7,34.1,28.2z M32.8,23.2c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C34.5,23.5,33.6,23,32.8,23.2z"/%3E%3Cpath class="st4" d="M24.2,23.5c-1.9,0.5-3.8-0.6-4.3-2.5s0.6-3.8,2.5-4.3s3.8,0.6,4.3,2.5S26.1,23,24.2,23.5z M22.9,18.6 c-0.9,0.2-1.4,1.1-1.1,2c0.2,0.9,1.1,1.4,2,1.1c0.9-0.2,1.4-1.1,1.1-2C24.7,18.8,23.8,18.3,22.9,18.6z"/%3E%3Cpath class="st5" d="M26.5,51.5c13.8,0,25-11.2,25-25s-11.2-25-25-25s-25,11.2-25,25S12.7,51.5,26.5,51.5z"/%3E%3Cpath class="st4" d="M33.3,21h10c0.4,0,0.8-0.3,0.8-0.8s-0.3-0.8-0.8-0.8h-10C33.3,20.2,33.3,20.2,33.3,21z"/%3E%3C/g%3E%3Ccircle class="st6" cx="23.3" cy="20.1" r="2.5"/%3E%3Ccircle class="st6" cx="33.2" cy="24.8" r="2.5"/%3E%3Ccircle class="st6" cx="23" cy="34.8" r="2.5"/%3E%3C/svg%3E');
968 + }
969 + PHP_CSS;
908 970 wp_add_inline_style($handle, $css);
909 971 });
910 972
911 973 /**
@@ -983,8 +1045,334 @@
983 1045 }
984 1046 }
985 1047
986 1048
1049 +
1050 +function flrt_is_divi_theme()
1051 +{
1052 + if ( 'Divi' === wp_get_theme()->get('Name') || 'Divi' === wp_get_theme()->get_template() ) {
1053 + return true;
1054 + }
1055 + return false;
1056 +}
1057 +
1058 +if ( flrt_is_divi_theme() ) {
1059 +
1060 + function wpc_initialize_divi_custom_module() {
1061 + if (!class_exists('ET_Builder_Module')) {
1062 + return;
1063 + }
1064 +
1065 + flrt_include('src/Frontend/Builders/DiviWidgets/ChipsDiviWidget.php');
1066 + flrt_include('src/Frontend/Builders/DiviWidgets/FiltersDiviWidget.php');
1067 + flrt_include('src/Frontend/Builders/DiviWidgets/SortingDiviWidget.php');
1068 + }
1069 +
1070 + add_action('et_builder_ready', 'wpc_initialize_divi_custom_module');
1071 +
1072 + add_filter( 'et_builder_inner_content_class', function ($classes){
1073 + $classes[] = 'wpc-divi-inner-content';
1074 + return $classes;
1075 + }, 10 );
1076 +
1077 + if( flrt_get_option('mobile_filter_settings') === 'show_bottom_widget' ) {
1078 + if (flrt_get_experimental_option('disable_buttons') !== 'on') {
1079 + add_action('et_before_main_content', 'flrt_divi_filter_button');
1080 + }
1081 + }
1082 +}
1083 +
1084 +function flrt_divi_filter_button()
1085 +{
1086 + // et_before_main_content fires more than once per page when a Divi Theme
1087 + // Builder header layout is present (both header.php and
1088 + // theme-after-header.php do_action it), so nothing here may declare a
1089 + // function at runtime — the previous nested declaration fataled with
1090 + // "Cannot redeclare modify_specific_module" on the second call.
1091 + // Re-adding the same filter callback is a no-op in WordPress.
1092 + add_filter('et_module_process_display_conditions', 'flrt_divi_modify_specific_module', 10, 3);
1093 +}
1094 +
1095 +function flrt_divi_modify_specific_module($output, $render_slug, $module)
1096 +{
1097 + if ($module->slug === 'filter_everything') {
1098 + flrt_filters_button(0, '', 'et_before_main_content');
1099 + }
1100 + return $output;
1101 +}
1102 +/**
1103 + * Checks if the Breakdance plugin and its required classes/functions are active and exist.
1104 + *
1105 + * This function verifies the presence of the Breakdance plugin, along with specific
1106 + * classes and functions used by the plugin. It returns true only if all checks pass,
1107 + * indicating that Breakdance is properly installed and functional.
1108 + *
1109 + * @return bool True if Breakdance is active and its required components exist, false otherwise.
1110 + */
1111 +function flrt_check_breakdance() {
1112 + // is_plugin_active() lives in wp-admin/includes/plugin.php and is not loaded
1113 + // on the frontend, in WP-CLI or in cron. Fall back to the raw option list.
1114 + if ( ! function_exists( 'is_plugin_active' ) ) {
1115 + $active = (array) get_option( 'active_plugins', [] );
1116 + if ( is_multisite() ) {
1117 + $active = array_merge( $active, array_keys( (array) get_site_option( 'active_sitewide_plugins', [] ) ) );
1118 + }
1119 + if ( ! in_array( 'breakdance/plugin.php', $active, true ) ) {
1120 + return false;
1121 + }
1122 + } elseif ( ! is_plugin_active( 'breakdance/plugin.php' ) ) {
1123 + return false;
1124 + }
1125 +
1126 + if (!function_exists('Breakdance\Util\getDirectoryPathRelativeToPluginFolder')) {
1127 + return false;
1128 + }
1129 +
1130 + return true;
1131 +}
1132 +if(flrt_check_breakdance()){
1133 + function flrt_breakdance_custom_css() {
1134 + echo '<style>
1135 + .breakdance-add-panel__element{
1136 + background: #0A2D48;
1137 + }
1138 + </style>';
1139 + }
1140 + add_action('wp_head', 'flrt_breakdance_custom_css');
1141 + flrt_include('src/Frontend/Builders/breakdance/widgets/breakdance.php');
1142 +}
1143 +
1144 +/**
1145 + * Checks if Bricks Builder theme and its classes are ready to register custom elements.
1146 + *
1147 + * @return bool True if Bricks Builder theme is active and necessary classes exist, false otherwise.
1148 + */
1149 +function flrt_is_bricks_ready_for_elements() {
1150 + $theme = wp_get_theme();
1151 +
1152 + if (
1153 + $theme->get_stylesheet() !== 'bricks' &&
1154 + $theme->get_template() !== 'bricks'
1155 + ) {
1156 + return false;
1157 + }
1158 +
1159 + if ( ! class_exists( '\Bricks\Elements' ) ) {
1160 + return false;
1161 + }
1162 +
1163 + if ( ! method_exists( '\Bricks\Elements', 'register_element' ) ) {
1164 + return false;
1165 + }
1166 +
1167 + return true;
1168 +}
1169 +
1170 +/**
1171 + * Registers custom Bricks elements during WordPress initialization.
1172 + *
1173 + * This function checks if Bricks Builder is ready using flrt_is_bricks_ready_for_elements().
1174 + * If it is, it includes the ChipsBricksWidget.php file and registers the element using Bricks\Elements::register_element().
1175 + */
1176 +
1177 +add_action('init', 'flrt_init_bricks_widgets', 11);
1178 +
1179 +function flrt_init_bricks_widgets() {
1180 + if (flrt_is_bricks_ready_for_elements()) {
1181 + $element_files = [
1182 + FLRT_PLUGIN_DIR_PATH .'src/Frontend/Builders/bricks/ChipsBricksWidget.php',
1183 + FLRT_PLUGIN_DIR_PATH .'src/Frontend/Builders/bricks/FiltersBricksWidget.php',
1184 + FLRT_PLUGIN_DIR_PATH .'src/Frontend/Builders/bricks/SortingBricksWidget.php',
1185 + ];
1186 + foreach ($element_files as $file) {
1187 + \Bricks\Elements::register_element($file);
1188 + }
1189 +
1190 + add_filter( 'bricks/builder/i18n', function( $i18n ) {
1191 + $i18n['filter-everything'] = esc_html__( 'Filter Everything', 'filter-everything' );
1192 + return $i18n;
1193 + } );
1194 +
1195 + function flrt_bricks_custom_css() {
1196 + echo '<style>
1197 + .wpc-fe-icon {
1198 + background: var(--builder-color);
1199 + mask-image: url(' . flrt_get_icon_logo_svg_css() . ');
1200 + mask-repeat: no-repeat;
1201 + mask-size: contain;
1202 + display: inline-block;
1203 + width: 28px;
1204 + height: 28px;
1205 + margin-bottom: -5px;
1206 + }
1207 +
1208 + .bricks-add-element:focus .wpc-fe-icon, .bricks-add-element:hover .wpc-fe-icon {
1209 + background: var(--builder-color-accent);
1210 + }
1211 +
1212 + .structure-item .wpc-fe-icon {
1213 + width: 16px;
1214 + height: 16px;
1215 + margin-bottom: 0px;
1216 + }
1217 + </style>';
1218 + }
1219 + add_action('wp_head', 'flrt_bricks_custom_css');
1220 + }
1221 +}
1222 +
1223 +function wpc_beaver_builder_widgets_load() {
1224 + if ( class_exists( 'FLBuilder' ) ) {
1225 + flrt_include('src/Frontend/Builders/beaver/chips/ChipsBeaverWidget.php');
1226 + flrt_include('src/Frontend/Builders/beaver/filters/FiltersBeaverWidget.php');
1227 + flrt_include('src/Frontend/Builders/beaver/sorting/SortingBeaverWidget.php');
1228 + }
1229 +}
1230 +add_action( 'init', 'wpc_beaver_builder_widgets_load' );
1231 +
1232 +/**
1233 + * XStore theme — "Display variable products as single variations" compatibility.
1234 + *
1235 + * With that XStore option (variable_products_detach) the theme:
1236 + * 1. adds 'product_variation' to the shop query's post_type, hides variable
1237 + * parents via post__not_in and flags the query with single_variations_filter=yes;
1238 + * 2. on posts_clauses (priority 20) appends a TOP-LEVEL
1239 + * "OR ( post_type='product_variation' AND post_status='publish' AND … )"
1240 + * branch, re-implementing WooCommerce's own layered-nav filters for the
1241 + * detached variations (price, rating, brand, chosen attributes from $_GET).
1242 + *
1243 + * The theme knows nothing about Filter Everything, so on FE-filtered pages that
1244 + * OR branch let EVERY published variation into the results, past FE's term
1245 + * constraints — filtering visually "did nothing" (each alternative of a
1246 + * top-level OR must repeat the filter conditions).
1247 + *
1248 + * Fix: append FE's active filter constraints AFTER the theme's branch
1249 + * (priority 30). AND binds tighter than OR, so in
1250 + * <first alternative> OR ( <theme branch> ) AND ( <FE constraints> )
1251 + * the constraints apply to the variations branch only, leaving the first
1252 + * alternative (already filtered by FE the regular way) untouched.
1253 + */
1254 +function flrt_xstore_detached_variations_where( $clauses, $wp_query ) {
1255 + global $wpdb;
1256 +
1257 + if ( is_admin() || empty( $clauses['where'] ) ) {
1258 + return $clauses;
1259 + }
1260 +
1261 + // Only XStore "detached variations" queries that FE has actually filtered.
1262 + if ( $wp_query->get( 'single_variations_filter' ) !== 'yes' || ! $wp_query->get( 'flrt_filtered_query' ) ) {
1263 + return $clauses;
1264 + }
1265 +
1266 + // The theme adds its branch at priority 20 — bail if it is not there.
1267 + if ( strpos( $clauses['where'], "OR ({$wpdb->posts}.post_type = 'product_variation'" ) === false ) {
1268 + return $clauses;
1269 + }
1270 +
1271 + $wpManager = \FilterEverything\Filter\Container::instance()->getWpManager();
1272 + $queried_values = $wpManager->getQueryVar( 'queried_values' );
1273 +
1274 + if ( empty( $queried_values ) || ! is_array( $queried_values ) ) {
1275 + return $clauses;
1276 + }
1277 +
1278 + $conditions = [];
1279 +
1280 + foreach ( $queried_values as $queried ) {
1281 +
1282 + if ( ! isset( $queried['entity'], $queried['e_name'] ) ) {
1283 + continue;
1284 + }
1285 +
1286 + // Taxonomy filters: a variation matches when its PARENT product carries
1287 + // the term (variations have no term_relationships rows of their own).
1288 + if ( $queried['entity'] === 'taxonomy' && ! empty( $queried['values'] ) ) {
1289 + $tax = $queried['e_name'];
1290 + $and_logic = ( isset( $queried['logic'] ) && $queried['logic'] === 'and' );
1291 + $groups = []; // one ttid-group per condition: single for OR-logic, per-term for AND-logic
1292 + $slugs = [];
1293 +
1294 + foreach ( (array) $queried['values'] as $value_slug ) {
1295 + $term = get_term_by( 'slug', $value_slug, $tax );
1296 + if ( ! $term ) {
1297 + continue;
1298 + }
1299 + $slugs[] = esc_sql( $term->slug );
1300 +
1301 + $ttids = [ (int) $term->term_taxonomy_id ];
1302 + if ( is_taxonomy_hierarchical( $tax ) && ! $and_logic ) {
1303 + foreach ( get_term_children( $term->term_id, $tax ) as $child_id ) {
1304 + $child = get_term( $child_id, $tax );
1305 + if ( $child && ! is_wp_error( $child ) ) {
1306 + $ttids[] = (int) $child->term_taxonomy_id;
1307 + }
1308 + }
1309 + }
1310 +
1311 + if ( $and_logic ) {
1312 + $groups[] = $ttids; // every term required — own condition each
1313 + } elseif ( empty( $groups ) ) {
1314 + $groups[] = $ttids; // any term enough — collect into one IN()
1315 + } else {
1316 + $groups[0] = array_merge( $groups[0], $ttids );
1317 + }
1318 + }
1319 +
1320 + if ( empty( $groups ) ) {
1321 + continue;
1322 + }
1323 +
1324 + foreach ( $groups as $group_ttids ) {
1325 + $ttids_in = implode( ',', array_unique( $group_ttids ) );
1326 + $parent_has_term = "{$wpdb->posts}.post_parent IN ( SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id IN ({$ttids_in}) )";
1327 +
1328 + if ( strpos( $tax, 'pa_' ) === 0 && ! $and_logic && ! empty( $slugs ) ) {
1329 + // Variation attributes: prefer the variation's own value —
1330 + // a variation with a DIFFERENT value must not ride in on its
1331 + // parent's term. Variations without own value ("Any …")
1332 + // fall back to the parent's term.
1333 + $meta_key = esc_sql( 'attribute_' . $tax );
1334 + $slugs_in = "'" . implode( "','", $slugs ) . "'";
1335 +
1336 + $conditions[] = "( {$wpdb->posts}.ID IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '{$meta_key}' AND meta_value IN ({$slugs_in}) )"
1337 + . " OR ( {$parent_has_term}"
1338 + . " AND {$wpdb->posts}.ID NOT IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '{$meta_key}' AND meta_value <> '' ) ) )";
1339 + } else {
1340 + $conditions[] = $parent_has_term;
1341 + }
1342 + }
1343 + }
1344 +
1345 + // Numeric meta filters (price and alike): variations carry their own value.
1346 + if ( $queried['entity'] === 'post_meta_num' && isset( $queried['values'] ) && is_array( $queried['values'] ) ) {
1347 + $meta_key = esc_sql( $queried['e_name'] );
1348 + $min = ( isset( $queried['values']['min'] ) && $queried['values']['min'] !== '' ) ? (float) $queried['values']['min'] : false;
1349 + $max = ( isset( $queried['values']['max'] ) && $queried['values']['max'] !== '' ) ? (float) $queried['values']['max'] : false;
1350 +
1351 + $range = [];
1352 + if ( $min !== false ) {
1353 + $range[] = "CAST(meta_value AS DECIMAL(15,6)) >= {$min}";
1354 + }
1355 + if ( $max !== false ) {
1356 + $range[] = "CAST(meta_value AS DECIMAL(15,6)) <= {$max}";
1357 + }
1358 +
1359 + if ( $range ) {
1360 + $conditions[] = "{$wpdb->posts}.ID IN ( SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key = '{$meta_key}' AND " . implode( ' AND ', $range ) . " )";
1361 + }
1362 + }
1363 +
1364 + // Other filter entities (post_meta choices, author, post_date …) are not
1365 + // mirrored into the variations branch yet — they are rare on shop archives.
1366 + }
1367 +
1368 + if ( ! empty( $conditions ) ) {
1369 + $clauses['where'] .= ' AND ( ' . implode( ' ) AND ( ', $conditions ) . ' )';
1370 + }
1371 +
1372 + return $clauses;
1373 +}
1374 +add_filter( 'posts_clauses', 'flrt_xstore_detached_variations_where', 30, 2 );
987 1375
988 1376 //@todo check this with PLL support
989 1377 //function flrt_add_cpt_to_pll_tmp( $post_types, $is_settings ) {
990 1378 // if ( $is_settings ) {