Filter hook 'default_title'

in WP Core File wp-admin/includes/post.php at line 824

View Source

default_title

Filter Hook
Description
Filters the default post title initially used in the "Write Post" form.

Hook Information

File Location wp-admin/includes/post.php View on GitHub
Hook Type Filter
Line Number 824

Hook Parameters

Type Name Description
string $post_title Default post title.
WP_Post $post Post object.

Usage Examples

Basic Usage
<?php
// Hook into default_title
add_filter('default_title', 'my_custom_filter', 10, 2);

function my_custom_filter($post_title, $post) {
    // Your custom filtering logic here
    return $post_title;
}

Source Code Context

wp-admin/includes/post.php:824 - How this hook is used in WordPress core
<?php
 819  	 * @since 1.5.0
 820  	 *
 821  	 * @param string  $post_title Default post title.
 822  	 * @param WP_Post $post       Post object.
 823  	 */
 824  	$post->post_title = (string) apply_filters( 'default_title', $post_title, $post );
 825  
 826  	/**
 827  	 * Filters the default post excerpt initially used in the "Write Post" form.
 828  	 *
 829  	 * @since 1.5.0

PHP Documentation

<?php
/**
	 * Filters the default post title initially used in the "Write Post" form.
	 *
	 * @since 1.5.0
	 *
	 * @param string  $post_title Default post title.
	 * @param WP_Post $post       Post object.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/includes/post.php
Related Hooks

Related hooks will be displayed here in future updates.