Browse: Home / Hooks /

learndash_wrapper_class

apply_filters( 'learndash_wrapper_class',  string $wrapper_class,  int|object $post,  string $additional_classes )

Filters LearnDash content wrapper class.


Description #


Parameters #

$wrapper_class

(string) Wrapper class.

$post

(int|object) Post ID or post object.

$additional_classes

(string) Additional classes to add to the wrapper.


Source #

File: themes/helpers.php


Examples #

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

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

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

Changelog #

Changelog
Version Description
4.6.0 Added the optional $additional_classes parameter.
3.0.0 Introduced.