submitpage_boxaction-hookWP 2.5.0

Fires before the meta boxes in the sidebar (side position) when editing a page (post_type = page), allowing the displayed content to be changed.

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

To add content for posts and other post types, use the submitpost_box hook.

Usage

add_action( 'submitpage_box', 'wp_kama_submitpage_box_action' );

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

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

Examples

#1 Add a block containing a quote

<?php
add_action( 'submitpage_box', 'add_blockquote_submitpage_box' );
function add_blockquote_submitpage_box( $post ) {
	?>
	<div class="block-blockquote">
		<blockquote>
			❝
			The art of good writing consists in feeling well, thinking well, and expressing well.
			❞
		</blockquote>
		<i>Jean Duclos</i>
	</div>

	<style>
		.block-blockquote {
			margin-bottom: 10px;
			padding: 15px;
			background: #fff
		}

		.block-blockquote blockquote {
			margin: 0;
		}

		.block-blockquote i {
			display: block;
			margin-top: 5px;
			text-align: right;
		}
	</style>
	<?php
}

Changelog

Since 2.5.0 Introduced.

Where the hook is called

In file: /wp-admin/edit-form-advanced.php
submitpage_box
wp-admin/edit-form-advanced.php 699
do_action( 'submitpage_box', $post );

Where the hook is used in WordPress

Usage not found.