learndash_post_type_has_archive

apply_filters( 'learndash_post_type_has_archive',  boolean $has_archive,  string $post_type )

Filters whether a post type has archive or not.


Description #


Parameters #

$has_archive

(boolean) Whether the post type has archive or not.

$post_type

(string) Post type slug.


Source #

File: includes/ld-misc-functions.php


Examples #

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

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

Changelog #

Changelog
Version Description
3.0.0 Introduced.