$skin ) ) {
return false;
}
return ! empty( $loop_widget_settings[ $skin . '_query_include' ] ) &&
in_array( 'terms', $loop_widget_settings[ $skin . '_query_include' ] ) &&
isset( $loop_widget_settings[ $skin . '_query_include_term_ids' ] ) &&
! in_array( $term->term_id, $loop_widget_settings[ $skin . '_query_include_term_ids' ] );
}
public function is_loop_grid_include_exclude_tax_belong_to_filter_tax( array $loop_widget_settings, WP_Term $term, string $skin ) : bool {
$include_exclude_term_ids = array_merge(
$loop_widget_settings[ $skin . '_query_include_term_ids' ] ?? [],
$loop_widget_settings[ $skin . '_query_exclude_term_ids' ] ?? []
);
foreach ( $include_exclude_term_ids as $term_id ) {
$term_to_include_exclude = get_term_by( 'term_taxonomy_id', $term_id );
if ( $term_to_include_exclude && $term_to_include_exclude->taxonomy === $term->taxonomy ) {
return true;
}
}
return false;
}
/**
* @return boolean
*/
public function is_term_selected_for_exclusion( $loop_widget_settings, $term, $skin ) {
return ! empty( $loop_widget_settings[ $skin . '_query_exclude' ] ) &&
in_array( 'terms', $loop_widget_settings[ $skin . '_query_exclude' ] ) &&
isset( $loop_widget_settings[ $skin . '_query_exclude_term_ids' ] ) &&
in_array( $term->term_id, $loop_widget_settings[ $skin . '_query_exclude_term_ids' ] );
}
/**
* @return boolean
*/
public function should_exclude_term_by_manual_selection( $loop_widget_settings, $term, $user_selected_taxonomy, $skin ) {
if ( ! $this->loop_widget_has_manual_selection( $loop_widget_settings, $skin ) ) {
return false;
}
$terms_to_exclude_by_manual_selection = $this->get_terms_to_exclude_by_manual_selection( $loop_widget_settings[ $skin . '_query_exclude_ids' ] ?? [], $user_selected_taxonomy );
if ( in_array( $term->term_id, $terms_to_exclude_by_manual_selection ) ) {
return true;
}
return false;
}
/**
* @return boolean
*/
private function loop_widget_has_manual_selection( $loop_widget_settings, $skin ) {
return ! empty( $loop_widget_settings[ $skin . '_query_exclude' ] ) &&
in_array( 'manual_selection', $loop_widget_settings[ $skin . '_query_exclude' ] ) &&
! empty( $loop_widget_settings[ $skin . '_query_exclude_ids' ] );
}
/**
* @return array
*/
private function get_terms_to_exclude_by_manual_selection( $selected_posts, $user_selected_taxonomy ) {
$terms_to_exclude = [];
$term_exclude_counts = [];
$term_actual_counts = [];
foreach ( $selected_posts as $post_id ) {
$this->calculate_post_terms_counts( $post_id, $user_selected_taxonomy, $term_exclude_counts, $term_actual_counts );
}
foreach ( $term_exclude_counts as $term_id => $selected_count ) {
$this->maybe_add_term_to_exclusion( $term_id, $selected_count, $term_actual_counts, $terms_to_exclude );
}
return $terms_to_exclude;
}
/**
* @return void
*/
private function calculate_post_terms_counts( $post_id, $user_selected_taxonomy, &$term_exclude_counts, &$term_actual_counts ) {
$post_terms = wp_get_post_terms( $post_id, $user_selected_taxonomy );
foreach ( $post_terms as $term ) {
$this->calculate_term_counts( $term, $term_exclude_counts, $term_actual_counts );
}
}
/**
* @return void
*/
private function calculate_term_counts( $term, &$term_exclude_counts, &$term_actual_counts ) {
if ( empty( $term_exclude_counts[ $term->term_id ] ) ) {
$term_exclude_counts[ $term->term_id ] = 0;
}
$term_exclude_counts[ $term->term_id ] = (int) $term_exclude_counts[ $term->term_id ] + 1;
$term_actual_counts[ $term->term_id ] = (int) $term->count;
}
/**
* @return void
*/
private function maybe_add_term_to_exclusion( $term_id, $selected_count, $term_actual_counts, &$terms_to_exclude ) {
$user_selected_all_the_posts_for_this_term = $selected_count >= $term_actual_counts[ $term_id ];
if ( $user_selected_all_the_posts_for_this_term ) {
$terms_to_exclude[] = $term_id;
}
}
public function __construct() {
parent::__construct();
$this->query = Query_Constants::DATA;
if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
$this->maybe_populate_filters_from_query_string();
}
// Register the controller.
new Controller();
add_filter( 'elementor/query/query_args', [ $this, 'filter_loop_query' ], 10, 2 );
add_filter( 'elementor_pro/editor/localize_settings', [ $this, 'add_localize_data' ] );
add_filter( 'paginate_links', [ $this, 'remove_rest_route_parameter' ] );
add_action( 'elementor/frontend/after_register_styles', [ $this, 'register_styles' ] );
}
}
Fatal error: Uncaught Error: Class '\ElementorPro\Modules\LoopFilter\Module' not found in /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor-pro/core/modules-manager.php:92
Stack trace:
#0 /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor-pro/plugin.php(350): ElementorPro\Core\Modules_Manager->__construct()
#1 /var/www/html/dportilho.com.br/web/wp-includes/class-wp-hook.php(341): ElementorPro\Plugin->on_elementor_init('')
#2 /var/www/html/dportilho.com.br/web/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters('', Array)
#3 /var/www/html/dportilho.com.br/web/wp-includes/plugin.php(522): WP_Hook->do_action(Array)
#4 /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor/includes/plugin.php(632): do_action('elementor/init')
#5 /var/www/html/dportilho.com.br/web/wp-includes/class-wp-hook.php(341): Elementor\Plugin->init('')
#6 /var/www/html/dportilho.com.br/web/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array)
#7 /var/www/html/dportilho.com.br/web/wp-includes/p in /var/www/html/dportilho.com.br/web/wp-content/plugins/elementor-pro/core/modules-manager.php on line 92