post_type_labels_{$post_type}

最后更新于:2021-11-27 17:50:20

apply_filters( “post_type_labels_{$post_type}”, object $labels )

Filters the labels of a specific post type.

参数

$labels

(object)
Object with labels for the post type as member variables.

源文件

文件: gc-includes/post.php

View on Trac

/**
 * Changes strings referencing Featured Images for a post type
 * 
 * @param 		object 		$labels 		Current post type labels
 * @return 		object 					Modified post type labels
 */
function change_featured_image_labels( $labels ) {

	$labels->featured_image 	= 'Headshot';
	$labels->set_featured_image 	= 'Set headshot';
	$labels->remove_featured_image 	= 'Remove headshot';
	$labels->use_featured_image 	= 'Use as headshot';

	return $labels;

} // change_featured_image_labels()

add_filter( 'post_type_labels_employee', 'change_featured_image_labels', 10, 1 );