learndash-content-tabs-{$tab[‘id’]}-before

do_action( "learndash-content-tabs-{$tab[‘id’]}-before",  int|false $post_id,  string $context,  int $course_id,  int $user_id )

Fires before any tab.


Description #

The dynamic portion of the hook name, $tab['id], refers id of the tab.


Parameters #

$post_id

(int|false) Post ID.

$context

(string) The context for which the hook is fired such as course , lesson, topic, quiz, etc.

$course_id

(int) Course ID.

$user_id

(int) User ID.


Source #

File: themes/ld30/templates/modules/tabs.php


Examples #

 <?php
/**
 * Example usage for learndash-content-tabs-{$tab['id']}-before action.
 */
add_action(
	'learndash-content-tabs-materials-before',
	function( $post_id, $context, $course_id, $user_id ) {
		// May add any custom logic using $post_id, $context, $course_id, $user_id

		echo '<div>Custom content or markup</div>';
	},
	10,
	4
);