WordPress.org

Codex

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() {
	if( $_GET['post_type'] == 'my_custom_post_type' ) {
		return 'My Filtered Title';
	}
}

add_filter('default_title', 'my_default_title_filter');