learndash_transients_disabled

apply_filters( 'learndash_transients_disabled',  boolean $transients_disabled,  string $transient_key )

Filters whether the transients are disabled or not.


Description #


Parameters #

$transients_disabled

(boolean) Whether the transients are disabled or not.

$transient_key

(string) Transient Key.


Source #

File: includes/class-ldlms-transients.php


Examples #

 <?php
/**
 * Example usage for learndash_transients_disabled filter.
 */
add_filter(
	'learndash_transients_disabled',
	function( $disabled, $key = '' ) {

		// Example disable using transient for the the key 'learndash_user_groups_1'
		if ( $key == 'learndash_user_groups_1' ) {
			$disabled = true;
		}

		return $disabled;
	},
	10,
	2
);