edit_form_top
Fires before the post title input field, allowing the displayed content to be changed.
This hook fires after all hidden fields and nonce fields have been output.
Usage
add_action( 'edit_form_top', 'wp_kama_edit_form_top_action' );
/**
* Function for `edit_form_top` action-hook.
*
* @param WP_Post $post Post object.
*
* @return void
*/
function wp_kama_edit_form_top_action( $post ){
// action...
}
- $post(WP_Post)
- The post object. See get_post() for the object structure.
Examples
#1 Display custom text above the post title field in the admin area
add_action( 'edit_form_top', 'callback__edit_form_top' );
function callback__edit_form_top( $post ) {
?>
<div style="margin-top: 10px;padding: 15px;color: #fff;background: #673AB7;clear: both;">
The <b>edit_form_top</b> hook fired here.
</div>
<?php
}
Changelog
| Since 3.7.0 | Introduced. |
Where the hook is called
In file: /wp-admin/edit-form-advanced.php
edit_form_top
wp-admin/edit-form-advanced.php 519
do_action( 'edit_form_top', $post );
