default_excerpt
Filter HookDescription
Filters the default post excerpt initially used in the "Write Post" form.Hook Information
File Location |
wp-admin/includes/post.php
View on GitHub
|
Hook Type | Filter |
Line Number | 834 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$post_excerpt
|
Default post excerpt. |
WP_Post
|
$post
|
Post object. |
Usage Examples
Basic Usage
<?php
// Hook into default_excerpt
add_filter('default_excerpt', 'my_custom_filter', 10, 2);
function my_custom_filter($post_excerpt, $post) {
// Your custom filtering logic here
return $post_excerpt;
}
Source Code Context
wp-admin/includes/post.php:834
- How this hook is used in WordPress core
<?php
829 * @since 1.5.0
830 *
831 * @param string $post_excerpt Default post excerpt.
832 * @param WP_Post $post Post object.
833 */
834 $post->post_excerpt = (string) apply_filters( 'default_excerpt', $post_excerpt, $post );
835
836 return $post;
837 }
838
839 /**
PHP Documentation
<?php
/**
* Filters the default post excerpt initially used in the "Write Post" form.
*
* @since 1.5.0
*
* @param string $post_excerpt Default post excerpt.
* @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.