learndash_content_access

apply_filters( 'learndash_content_access',  string $message,  WP_Post $quiz_post )

Filters quiz shortcode content access message.


Description #

If not null, message display instead of quiz content.


Parameters #

$message

(string) The content access message.

$quiz_post

(WP_Post) Quiz WP_Post object.


Source #

File: includes/shortcodes/ld_quiz.php


Examples #

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

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

Changelog #

Changelog
Version Description
2.1.0 Introduced.