Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

User:Roccotripaldi/Plugin API/Filter Reference/default title

This article is a ROUGH DRAFT. The author is still working on this document, so please do not edit this without the author's permission. The content within this article may not yet be verified or valid. This information is subject to change.

Description

The default_title filter runs in wp-admin when adding a new post, page, or custom post type. This filter allows you to change the default title that is displayed in the title field.

Usage

function my_default_title_filter() {
	global $post_type;
	if ('my_custom_post_type' == $post_type) {
		return 'My Filtered Title';
	}
}
add_filter('default_title', 'my_default_title_filter');