apply_filters( 'clarkson_core_template_name', $name, $filename ) → {string}
Rename templates shown in the page template dropdown.
Parameters:
Name | Type | Description |
---|---|---|
$name |
string | The name calculated by Clarkson Core from the filename. |
$filename |
string | The filename of the template being renamed. |
- Since:
- 1.2.0
- Source:
Returns:
The new name for the template.
- Type
- string
Example
// It is possible to change a template name with the filter.
add_filter( 'clarkson_core_template_name', function( string $name, string $filename ): string {
if( $filename === 'template-contact.twig' ){
return __( 'Contact and location', 'textdomain' );
}
return $name;
} );