Browse: Home / Hooks /

label_to_slug

This hook has been deprecated. Use the ‘learndash_label_to_slug’ filter instead.

apply_filters_deprecated( 'label_to_slug',  string $label,  string $key )

Filters the value of the slug after the conversion from the label. Used to filter slug value in label_to_slug function.


Description #


Parameters #

$label

(string) Label entered on settings page.

$key

(string) Key name of setting field.


Source #

File: includes/class-ld-custom-label.php


Examples #

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

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

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

Changelog #

Changelog
Version Description
4.5.0 Introduced. Use the 'learndash_label_to_slug' filter instead.