Add Filter Hooks.
173712
public function add_hook() {

		add_filter(
			'post_type_link',
			array( $this, 'post_type_link' ),
			apply_filters( 'cptp_post_type_link_priority', 0 ),
			4
		);

		add_filter(
			'term_link',
			array( $this, 'term_link' ),
			apply_filters( 'cptp_term_link_priority', 0 ),
			3
		);

		add_filter(
			'attachment_link',
			array( $this, 'attachment_link' ),
			apply_filters( 'cptp_attachment_link_priority', 20 ),
			2
		);
	}
1210375
def _add_filter_node(root, filter_, value):
        """"""
        filter_el = ElementTree.SubElement(root, 'Filter')
        filter_el.set('name', filter_.name)

        # Set filter value depending on type.
        if filter_.type == 'boolean':
            # Boolean case.
            if value is True or value.lower() in {'included', 'only'}:
                filter_el.set('excluded', '0')
            elif value is False or value.lower() == 'excluded':
                filter_el.set('excluded', '1')
            else:
                raise ValueError('Invalid value for boolean filter ({})'
                                 .format(value))
        elif isinstance(value, list) or isinstance(value, tuple):
            # List case.
            filter_el.set('value', ','.join(map(str, value)))
        else:
            # Default case.
            filter_el.set('value', str(value))
820606
protected function addFilters()
    {
        if ($this->parser->getFilters()) {

            $this->query->whereRaw($this->parser->getFilters());
        }

        return $this;
    }
1145124
protected function load_hooks() {
		add_action( 'init', [ $this, 'load' ] );
		add_action( 'init', [ $this, 'background_update' ] );
		add_action( 'init', [ $this, 'set_options_filter' ] );
		add_action( 'wp_ajax_github-updater-update', [ $this, 'ajax_update' ] );
		add_action( 'wp_ajax_nopriv_github-updater-update', [ $this, 'ajax_update' ] );

		// Load hook for shiny updates Basic Authentication headers.
		if ( self::is_doing_ajax() ) {
			$this->load_authentication_hooks();
		}

		add_filter( 'extra_theme_headers', [ $this, 'add_headers' ] );
		add_filter( 'extra_plugin_headers', [ $this, 'add_headers' ] );
		add_filter( 'upgrader_source_selection', [ $this, 'upgrader_source_selection' ], 10, 4 );

		// Needed for updating from update-core.php.
		if ( ! self::is_doing_ajax() ) {
			add_filter( 'upgrader_pre_download', [ $this, 'upgrader_pre_download' ], 10, 3 );
		}
	}
1372872
private void addIfAccept(Class<?> clazz) {
		if (null != clazz) {
			Filter<Class<?>> classFilter = this.classFilter;
			if (classFilter == null || classFilter.accept(clazz)) {
				this.classes.add(clazz);
			}
		}
	}
558049
protected function addColumnFilters()
    {
        foreach ($this->columns as $i => $column) {
            if (static::$versionTransformer->isColumnSearched($i)) {
                $this->builder->where(
                    new raw($this->getRawColumnQuery($column)),
                    'like',
                    '%' . static::$versionTransformer->getColumnSearchValue($i) . '%'
                );
            }
        }
    }
647119
def add_io_hook(self, hook):
        
        def proxy(*args):
            hook(*args)

        self._io_hooks.append(proxy)

        return self.HookRemover(lambda: self._io_hooks.remove(proxy))
70529
public void add(HttpMethod httpMethod, FilterImpl filter) {
        add(httpMethod, filter.getPath() , filter.getAcceptType(), filter);
    }
60955
public function add_hooks()
	{
		if ( function_exists( 'add_action' )
			&& function_exists( 'add_filter' )
			&& function_exists( 'add_shortcode' )
		) {
			// Actions
			foreach ( $this->actions as $action ) {
				add_action(
					$action['hook'],
					[ &$this, $this->get_mapped_mvc_call( $action['mvc'] ) ],
					$action['priority'],
					$action['args']
				);
			}
			// Filters
			foreach ( $this->filters as $filter ) {
				add_filter(
					$filter['hook'],
					[ &$this, $this->get_mapped_mvc_call( $filter['mvc'], true ) ],
					$filter['priority'],
					$filter['args']
				);
			}
			// Filters
			foreach ( $this->shortcodes as $shortcode ) {
				add_shortcode(
					$shortcode['tag'],
					[ &$this, $this->get_mapped_mvc_call( $shortcode['mvc'], true ) ]
				);
			}
			// Widgets
			if ( count( $this->widgets ) > 0 ) {
        		add_action( 'widgets_init', [ &$this, '_widgets' ], 1 );
			}
		}
	}
1043973
def configure_filter(self, config):
        """"""
        if '()' in config:
            result = self.configure_custom(config)
        else:
            name = config.get('name', '')
            result = logging.Filter(name)
        return result
996210
public function hooks() {
		// Start and commit the session.
		add_action( 'plugins_loaded', [ $this, 'start_session' ] );
		add_action( 'shutdown', [ $this, 'commit_session' ] );

		// Register the garbage collector.
		add_action( 'wp', [ $this, 'register_garbage_collection' ] );
		add_action( $this->get_schedule_name(), [ $this, 'cleanup_expired_sessions' ] );
	}
1230630
public function hooks()
    {
        $this->hook->action(
            'init',
            [$this->taxonomy, 'register']
        )->dispatch();

        $this->hook->action(
            "{$this->taxonomy->getModel()->getSlug()}_add_form_fields",
            [$this->taxonomy, 'fill']
        )->dispatch();

        $this->hook->action(
            "{$this->taxonomy->getModel()->getSlug()}_edit_form_fields",
            [$this->taxonomy, 'fill']
        )->dispatch();

        $this->hook->action(
            "created_{$this->taxonomy->getModel()->getSlug()}",
            [$this->taxonomy, 'save']
        )->dispatch();

        $this->hook->action(
            "edited_{$this->taxonomy->getModel()->getSlug()}",
            [$this->taxonomy, 'save']
        )->dispatch();
    }
928247
private function applyFilters() {

		// handle default and pre-configured filters first

		foreach($this->defaultFilters as $f) {
			$f->apply($this->contents);
		}

		// handle added custom filters last

		foreach($this->filters as $f) {
			$f->apply($this->contents);
		}

	}
1319283
def push_filters(self, new_filters):
        
        t = self.tokenizer
        for f in new_filters:
            t = f(t)
        self.tokenizer = t
620254
def add_filter(self, package_filter):
        
        filters = self.filters + [package_filter]
        self.filters = sorted(filters, key=lambda x: x.cost)
1312777
private void addFilter(Filter filter) {
        boolean exists = false;
        for (Filter initedFilter : this.filters) {
            if (initedFilter.getClass() == filter.getClass()) {
                exists = true;
                break;
            }
        }

        if (!exists) {
            filter.init(this);
            this.filters.add(filter);
        }

    }
1320720
public function addCustomFilters()
    {
        foreach ($this->customFilters() as $name => $filter) {
            app('sanitizer')->extend($name, $filter);
        }
    }