learndash_post_type_rewrite_slug

apply_filters( 'learndash_post_type_rewrite_slug',  string $rewrite_slug,  string $post_type_slug )

Filters the rewrite slug for a post type.


Description #


Parameters #

$rewrite_slug

(string) Rewrite slug.

$post_type_slug

(string) Post type slug.


Source #

File: includes/class-ld-permalinks.php


Examples #

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

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