edit_form_advancedaction-hookWP 1.5.0

Fires after all meta boxes in the normal position but before those in the advanced position, allowing the displayed content to be controlled. Fires when adding or editing any post type except pages (post_type = page). Outputs nothing by default.

Read add_meta_box for information about meta box output locations (positions).

To output a similar block for pages (post_type = page), use the edit_page_form hook.

Usage

add_action( 'edit_form_advanced', 'wp_kama_edit_form_advanced_action' );

/**
 * Function for `edit_form_advanced` action-hook.
 * 
 * @param WP_Post $post Post object.
 *
 * @return void
 */
function wp_kama_edit_form_advanced_action( $post ){

	// action...
}
$post(WP_Post)
The post object. See get_post() for the object structure.

Examples

#1 Add a custom block

<?php
add_action( 'edit_form_advanced', 'add_block_edit_form_advanced' );
function add_block_edit_form_advanced( $post ) {
	?>
	<div class="my-box">
		<h1>Your content goes here</h1>
	</div>

	<style>
		.my-box h1 {
			margin-top: 10px;
			padding: 15px;
			color: #ffffff;
			background: #0085ba;
		}
	</style>
	<?php
}

Changelog

Since 1.5.0 Introduced.

Where the hook is called

In file: /wp-admin/edit-form-advanced.php
edit_form_advanced
wp-admin/edit-form-advanced.php 740
do_action( 'edit_form_advanced', $post );
wp-admin/includes/post.php 2559
do_action( 'edit_form_advanced', $post );

Where the hook is used in WordPress

wp-includes/class-wp-embed.php 46
add_action( 'edit_form_advanced', array( $this, 'maybe_run_ajax_cache' ) );