Register class conditional filters.

@since  1.0.0
513554
public function boot()
    {
        // Enable post-thumbnail support.
        $this->enable_thumbnail_support();

        // Register all image sizes.
        $this->register_image_sizes();

        // Remove all default image sizes.
        if (Config::get('images.reset_image_sizes') !== false) {
            $this->add_filter('intermediate_image_sizes_advanced', 'remove_default_image_sizes');
            $this->add_filter('intermediate_image_sizes_advanced', 'remove_custom_image_sizes');
            $this->add_filter('intermediate_image_sizes', 'remove_default_image_sizes');
        }

        if (! empty($this->size_dropdown_names)) {
            $this->add_filter('image_size_names_choose', 'enable_custom_image_sizes');
        }
    
        // Set default image size dropdown value.
        if (! empty(Config::get('images.insert_image_default_size'))) {
            $this->add_filter('after_setup_theme', 'set_insert_image_default_size');
        }

        if (Config::get('images.dynamic_image_sizes') !== false) {
            $this->add_filter('image_downsize', 'generate_dynamic_image');
        }
    }
1372872
private void addIfAccept(Class<?> clazz) {
		if (null != clazz) {
			Filter<Class<?>> classFilter = this.classFilter;
			if (classFilter == null || classFilter.accept(clazz)) {
				this.classes.add(clazz);
			}
		}
	}
161240
private function initFilterTypeExtensions()
    {
        $this->filterTypeExtensions = [];

        foreach ($this->loadFilterTypeExtensions() as $extension) {
            if (!$extension instanceof FilterTypeExtensionInterface) {
                throw new UnexpectedTypeException($extension, FilterTypeExtensionInterface::class);
            }

            $type = $extension->getExtendedType();

            $this->filterTypeExtensions[$type][] = $extension;
        }
    }
1145095
private function registerClasses()
	{
    	$this->addValidator(self::DEFAULT_VALIDATOR_LABEL, new Validator($this)); //Connect form validator
    	$this->setEntityRepository(new EntityRepository($this));
    	$this->setResponse(new Response($this));
    	$this->setDict(new Dictionary($this)); //Connect dictionary
    	$this->setStore(new Store($this)); //Connect Store
		$this->setBin(new Bin($this)); // Connect Bin
    	$this->setUserService(new UserService($this));
    	$this->setRouter(new Router($this));
    }
506570
protected function getFilterClassOptions()
    {
        // Create Options:
        
        $options = [];
        
        // Obtain Filter Subclasses:
        
        $filters = ClassInfo::subclassesFor(Filter::class);
        
        // Remove Abstract Superclass:
        
        array_shift($filters);
        
        // Define Options:
        
        foreach ($filters as $filter) {
            $options[$filter] = $filter::singleton()->getTitle();
        }
        
        // Sort Options, Ensuring Default Filter is First:
        
        uasort($options, function ($a, $b) {
            return ($a === DefaultFilter::singleton()->getTitle()) ? -1 : strcasecmp($a, $b);
        });
        
        // Answer Options:
        
        return $options;
    }
125366
public function filterRegistry()
    {
        $filters = [];
        foreach ($this->config->allFilters() as $name) {
            $filters[$name] = $this->buildFilter($name, $this->config->filterConfig($name));
        }
        return new FilterRegistry($filters);
    }
508432
public function addClassFilter($classes)
    {
        if (is_array($classes) && count($classes) !== 0) {
            $filters = array();
            foreach ($classes as $class) {
                class_exists($class);
                $filters[] = 'cc INSTANCE OF \''.  $class .'\'';
            }

            $filter = implode(' OR ', $filters);

            $this->andWhere($filter);
        }
    }
222685
public function initFilters()
    {

        //Only run on frontend
        if (is_admin()) {
            return;
        }

        global $wp_query;

        if ((is_category() || is_tax() || is_tag()) && !get_post_type()) {
            $postType = 'post';
        }

        $postType = get_post_type();

        if (!$postType && isset($wp_query->query['post_type'])) {
            $postType = $wp_query->query['post_type'];
        }

        if (!$postType) {
            return;
        }

        $queriedObject = get_queried_object();
        $objectId = null;
        if (isset($queriedObject->ID)) {
            $objectId = $queriedObject->ID;
        }

        $pageForPosts = get_option('page_for_' . get_post_type());

        if (($pageForPosts !== $objectId && !is_archive() && !is_post_type_archive() && !is_home() && !is_category() && !is_tax() && !is_tag()) || is_admin()) {
            return;
        }

        add_action('Municipio/viewData', function ($data) use ($wp_query, $postType) {

            //Get current post type enabledTaxonomyFilters
            if (!isset($data['postType']) || !$data['postType']) {
                $data['postType'] = $postType;
            }

            //Get header filters
            if ($enabledHeaderFilters = get_field('archive_' . $data['postType'] . '_post_filters_header', 'option')) {
                $data['enabledHeaderFilters'] = $enabledHeaderFilters;
            } else {
                $data['enabledHeaderFilters'] = array();
            }

            //Get taxonomy filters
            if ($enabledTaxonomyFilters = $this->getEnabledTaxonomies($data['postType'])) {
                $data['enabledTaxonomyFilters'] = $enabledTaxonomyFilters;
            } else {
                $data['enabledTaxonomyFilters'] = array();
            }

            //Is query string present?
            $data['queryString'] = (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) ? true : false;

            //The archive url
            $data['archiveUrl'] = $this->getArchiveSlug($postType);

            $data['searchQuery'] = $this->getSearchQuery();

            return $data;
        });
    }
528195
public function applyFilters()
    {
        if ($this->filters) {
            foreach ($this->filters as $k => $filter) {
                if (
                    isset($_GET[$filter['field']]) &&
                    !empty($_GET[$filter['field']]) &&
                    $_GET[$filter['field']] != $this->filterEmpty &&
                    @$_GET['filter'] != $filter['field']
                ) {
                    $this->model->addCondition($filter['field'], $_GET[$filter['field']]);
                }
            }
        }
    }
816846
protected function addOptimizableClasses()
    {
        $collection = $this->compiler->run();

        $this->displayAddedFiles($collection);

        $this->displayMissingFiles($collection);
    }
520513
public function all() {

		// If we already have attributes, let's return them and bail.
		if ( $this->attr ) {
			return $this->attr;
		}

		$defaults = [];

		// If the a class was input, we want to go ahead and set that as
		// the default class.  That way, filters can know early on that
		// a class has already been declared. Any filters on the defaults
		// should, ideally, respect any classes that already exist.
		if ( isset( $this->input['class'] ) ) {
			$defaults['class'] = $this->input['class'];

			// This is kind of a hacky way to keep the class input
			// from overwriting everything later.
			unset( $this->input['class'] );

		// If no class was input, let's build a custom default.
		} else {
			$defaults['class'] = $this->context ? "{$this->name} {$this->name}--{$this->context}" : $this->name;
		}

		// Compatibility with core WP attributes.
		if ( method_exists( $this, $this->name ) ) {
			$method   = $this->name;
			$defaults = $this->$method( $defaults );
		}

		// Filter the default attributes.
		$defaults = apply_filters( "hybrid/attr/{$this->name}/defaults", $defaults, $this->context, $this );

		// Merge the attributes with the defaults.
		$this->attr = wp_parse_args( $this->input, $defaults );

		// Apply filters to the parsed attributes.
		$this->attr = apply_filters( 'hybrid/attr', $this->attr, $this->name, $this->context );
		$this->attr = apply_filters( "hybrid/attr/{$this->name}", $this->attr, $this->context );

		// Provide a filter hook for the class attribute directly. The
		// classes are split up into an array for easier filtering. Note
		// that theme authors should still utilize the core WP body,
		// post, and comment class filter hooks. This should only be
		// used for custom attributes.
		$hook = "hybrid/attr/{$this->name}/class";

		if ( isset( $this->attr['class'] ) && has_filter( $hook ) ) {

			$classes = apply_filters( $hook, explode( ' ', $this->attr['class'] ), $this->context );

			$this->attr['class'] = join( ' ', array_unique( $classes ) );
		}

		return $this->attr;
	}
1069360
public function registerFilter($filterName)
    {
        $className = __CLASS__ . '\\Filter\\' . ucfirst($filterName);
        try {
            $filterInstance = $this->getClassInstance($className);
            if (!$filterInstance instanceof VoltFilterAbstract) {
                throw new InvalidFilterException();
            }
            $this->getCompiler()->addFilter($filterName, $filterInstance->getFilter());
        } catch (\ReflectionException $e) {
            throw new UnknownFilterException(sprintf('Filter \'%s\' does not exist', $filterName));
        } catch (\Exception $e) {
            throw new InvalidFilterException(sprintf('Invalid filter \'%s\'', $filterName));
        }
    }
582631
public function buildFilters()
    {
        $this->addFilter('title', new StringFilterType('title'), 'Title');
        $this->addFilter('online', new BooleanFilterType('online', 't'), 'Online');
        $this->addFilter('updated', new DateTimeFilterType('updated', 'v'), 'Updated at');
    }
499871
@SafeVarargs
    public static void registerFilterTypes(final Class<? extends DynamicFilter>... types) {
        FILTER_TYPES.addAll(Arrays.asList(types));
    }
201044
private function addFilters()
    {
        if (empty($this->filters)) {
            return;
        }
        foreach ($this->filters as $filter) {
            if (!class_exists($filter)) {
                continue;
            }
            $scope = app($filter);
            $this->addScope($scope);
        }

        return;
    }
192912
function() {
    var self = this;
    var fsm = self.filterStateModel;
    var filter = fsm.getActiveFilter();
    if (filter) {
      self.trigger("filter:apply", filter.cid, filter);
    }
  }
662988
public function hasFilters()
    {
        $params = array_except($this->params, ['order', 'limit']);

        return !empty($params) && !empty(array_values($params));
    }