Browse: Home / Hooks /

learndash_flush_rewrite_rules

apply_filters( 'learndash_flush_rewrite_rules',  boolean $should_flush,  array $post_options )

Filters whether to flush the rewrite rules.


Description #


Parameters #

$should_flush

(boolean) Whether to flush rewrite rules. The value should be true if the rules should be flushed otherwise false.

$post_options

(array) Array of post options.


Source #

File: includes/class-ld-cpt.php


Examples #

Note: Extended code example below not guaranteed, you may need to consult with a developer

 <?php
/**
 * Example usage for learndash_flush_rewrite_rules filter.
 */
add_filter(
	'learndash_flush_rewrite_rules',
	function( $should_flush, $post_options ) {
		// May add any custom logic using $should_flush, $post_options.

		// Always return $should_flush.
		return $should_flush;
	},
	10,
	2
);
 

Changelog #

Changelog
Version Description
2.1.0 Introduced.