| 1 |
<?php |
| 2 |
/** |
| 3 |
* Themify Compatibility Code |
| 4 |
* |
| 5 |
* @package Themify |
| 6 |
*/ |
| 7 |
|
| 8 |
/** |
| 9 |
* Toolset Views |
| 10 |
* @link https://toolset.com |
| 11 |
*/ |
| 12 |
class Themify_Compat_wpviews { |
| 13 |
|
| 14 |
static function init() { |
| 15 |
if ( function_exists( 'has_blocks' ) ) { |
| 16 |
add_filter( 'themify_deq_css', [ __CLASS__, 'themify_deq_css' ] ); |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
/* |
| 21 |
* @ref #9540 |
| 22 |
*/ |
| 23 |
public static function themify_deq_css( $css ) { |
| 24 |
if ( ( $key = array_search( 'wp-block-library', $css ) ) !== false ) { |
| 25 |
global $wp_query, $WPV_settings; |
| 26 |
$queried_term = $wp_query->get_queried_object(); |
| 27 |
if ( has_blocks( $WPV_settings[ 'view_taxonomy_loop_' . $queried_term->taxonomy ] ) ) { |
| 28 |
unset( $css[ $key ] ); |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
return $css; |
| 33 |
} |
| 34 |
} |