Add hook flush_rules

@since 0.7.9
481590
public function update_rules() {
		$post_types = CPTP_Util::get_post_types();
		foreach ( $post_types as $post_type ) {
			add_action( 'update_option_' . $post_type . '_structure', array( __CLASS__, 'queue_flush_rules' ), 10, 2 );
		}
		add_action( 'update_option_no_taxonomy_structure', array( __CLASS__, 'queue_flush_rules' ), 10, 2 );
	}
1081805
protected function flush()
    {
        echo "\nFlushing directories... ";
        foreach ($this->flushPaths as $dir) {
            $path = $this->basePath . '/' . $dir;
            if (file_exists($path)) {
                $this->flushDirectory($path);
            }
            $this->ensureDirectory($path);
        }
        echo "done\n";
    }
1161139
public static function flush() {
		if(self::$entity_manager == null)
			self::initialize();

		return call_user_func_array(array(self::$entity_manager, "flush"), func_get_args());
	}
389403
def add_hook(self, hook):
        
        h = hook.hash
        self.hooks[h] = hook
7995
public function flushPartialAction() {
        $postData = $this->getRequest()->getPost();
        if ( ! isset($postData['pattern'])) {
            $this->_getSession()->addError($this->__('Missing URL post data'));
        } else {
            $pattern = $postData['pattern'];
            Mage::dispatchEvent('turpentine_varnish_flush_partial',
                array('pattern' => $pattern));
            $result = Mage::getModel('turpentine/varnish_admin')
                ->flushUrl($pattern);
            foreach ($result as $name => $value) {
                if ($value === true) {
                    $this->_getSession()
                        ->addSuccess(Mage::helper('turpentine/data')
                            ->__('Flushed matching URLs for: ').$name);
                } else {
                    $this->_getSession()
                        ->addError(Mage::helper('turpentine/data')
                            ->__('Error flushing matching URLs on: ').$name);
                }
            }
        }
        $this->_redirect('*/cache');
    }
809484
def flush(self, meta=None):
        ''''''
        pattern = self.basekey(meta) if meta else self.namespace
        return self.client.delpattern('%s*' % pattern)
850569
public function flush() {
		$specRawer = new SpecRawer($this->attributes);
		$specRawer->rawTypes($this->eiTypeExtractions, $this->customTypeExtractions);
		$specRawer->rawEiMasks($this->eiTypeExtensionExtractionGroups);
		$specRawer->rawEiModificatorExtractionGroups($this->eiModificatorExtractionGroups);
		$specRawer->rawLaunchPads($this->launchPadExtractions);
		
		$this->configSource->writeArray($this->attributes->toArray());
	}
385905
public function flushMessage(){
        if( session_id() ){
            foreach( [ $this->error_key => 'error', $this->message_key => 'updated' ] as $key => $class_name ){
                if( isset($_SESSION[$key]) && !empty($_SESSION[$key]) ){
                    $markup = sprintf('<div class="%s"><p>%s</p></div>', $class_name, implode('<br />', $_SESSION[$key]));
                    if( is_admin() ){
                        echo $markup;
                    }else{
                        /**
                         * Post redirect get message's filter
                         *
                         * @param string $markup html string
                         * @param array $messages Messages' array
                         * @param string $class_name updated or error.
                         * @return string
                         */
                        echo apply_filters('wpametu_prg_message_class', $markup, $_SESSION[$key], $class_name);
                    }
                    // Make session empty.
                    $_SESSION[$key] = [];
                }
            }
        }
    }
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
		);
	}
1148088
function flushDynamicCssRules() {
        var rules = layoutStyleElem.sheet.cssRules,
            classCount = staleClassNames.length,
            i,
            j,
            ruleSuffix;

        for (i = 0; i < classCount; i++) {
            ruleSuffix = "." + staleClassNames[i] + " ";
            for (j = rules.length - 1; j >= 0; j--) {
                if (rules[j].selectorText.indexOf(ruleSuffix) !== -1) {
                    layoutStyleElem.sheet.deleteRule(j);
                }
            }
        }
        staleClassNames = [];
    }
361967
public static function flushEventListeners(): void
    {
        if (! isset(static::$dispatcher)) {
            return;
        }

        $instance = new static();
        $className = static::class;

        foreach ($instance->getObservableEvents() as $event) {
            $event = $instance->getObservableKey($event);

            static::$dispatcher->forget("{$event}: {$className}");
        }
    }
426446
public function hook()
    {
        wp_enqueue_script('jquery');

        add_action('wp_head', array($this, 'printToken'));
        add_action('admin_head', array($this, 'printToken'));

        add_action('wp_footer', array($this, 'printAjaxHeader'));
        add_action('admin_footer', array($this, 'printAjaxHeader'));
    }
86480
protected function flushIfNeeded() {
        if (!$this->_enabled) {
            return;
        }

        $now = $this->_util->nowMicros();
        $delta = $now - $this->_lastFlushMicros;

        // Set a bound on maximum flush frequency
        if ($delta < $this->_minFlushPeriodMicros) {
            return;
        }

        // Set a bound of minimum flush frequency
        if ($delta > $this->_maxFlushPeriodMicros) {
            $this->flush();
            return;
        }

        // Look for a trigger that a flush is warranted
        if (count($this->_logRecords) >= $this->_options["max_log_records"]) {
            $this->flush();
            return;
        }
        if (count($this->_spanRecords) >= $this->_options["max_span_records"]) {
            $this->flush();
            return;
        }
    }
648580
private function flush()
    {
        $currentConfigurationHash = $this->getCurrentConfigurationState();

        if ($currentConfigurationHash !== get_option('strata_rewrite_state')) {
            update_option('strata_rewrite_state', $currentConfigurationHash);
            flush_rewrite_rules();
            return true;
        }

        return false;
    }
193332
protected function flush()
    {
        $node = null;

        $this->isCode = false;

        if ($this->buffer) {
            switch ($this->state) {
            case self::STATE_TITLE:
                $data = implode("\n", $this->buffer);
                $level = $this->environment->getLevel($this->specialLetter);
                $token = $this->environment->createTitle($level);
                $node = $this->kernel->build('Nodes\TitleNode', $this->createSpan($data), $level, $token);
                break;
            case self::STATE_SEPARATOR:
                $level = $this->environment->getLevel($this->specialLetter);
                $node = $this->kernel->build('Nodes\SeparatorNode', $level);
                break;
            case self::STATE_CODE:
                $node = $this->kernel->build('Nodes\CodeNode', $this->buffer);
                break;
            case self::STATE_BLOCK:
                $node = $this->kernel->build('Nodes\QuoteNode', $this->buffer);
                $data = $node->getValue();
                $subParser = $this->getSubParser();
                $document = $subParser->parseLocal($data);
                $node->setValue($document);
                break;
            case self::STATE_LIST:
                $this->pushListLine(null, true);
                $node = $this->buffer;
                break;
            case self::STATE_TABLE:
                $node = $this->buffer;
                $node->finalize($this);
                break;
            case self::STATE_NORMAL:
                $this->isCode = $this->prepareCode();
                $node = $this->kernel->build('Nodes\ParagraphNode', $this->createSpan($this->buffer));
                break;
            }
        }

        if ($this->directive) {
            $currentDirective = $this->getCurrentDirective();
            if ($currentDirective) {
                $currentDirective->process($this, $node, $this->directive['variable'], $this->directive['data'], $this->directive['options']);
            }
            $node = null;
        }

        $this->directive = null;

        if ($node) {
            $this->document->addNode($node);
        }

        $this->init();
    }
1086367
public function hooks()
    {
        $this->hook->action(
            $this->isAllowedArea($this->getArea()),
            [$this, 'handleAction']
        )->dispatch();

        if (! empty($this->getArgument('execution'))) {
            $this->hook->filter(
                'script_loader_tag',
                [$this, 'addExecutionTypes']
            )->dispatch();
        }
    }
218046
public function flush(): void
    {
        if (empty($this->buffers)) {
            return;
        }

        foreach ($this->buffers as $buffer) {
            try {
                $this->sender->sendTo($buffer[0], $buffer[1], $buffer[2]);
            } catch (SenderException $e) {
                if (404 === $e->getCode()) {
                    $this->manager->remove($buffer[0]);
                }
            }
        }

        // WARNING! this will flush every models.
        // Worst case if we have invalid state model and not empty of this.buffers
        // buffers and invalid state models will be flush (eg. in process of none form.isValid())
        $this->manager->flush();
    }