post_menu_order хук-фильтрWP 2.3.0

Filters the value of a specific post field for display.

Only applied to post fields name which is not prefixed with post_.

Это один из вариантов динамического хука post_(field)

Использование

add_filter( 'post_menu_order', 'wp_kama_post_menu_order_filter', 10, 3 );

/**
 * Function for `post_menu_order` filter-hook.
 * 
 * @param mixed  $value   Value of the unprefixed post field.
 * @param int    $post_id Post ID
 * @param string $context Context for how to sanitize the field. Accepts 'raw', 'edit', 'db', 'display', 'attribute', or 'js'.
 *
 * @return mixed
 */
function wp_kama_post_menu_order_filter( $value, $post_id, $context ){

	// filter...
	return $value;
}
$value(разное)
Value of the unprefixed post field.
$post_id(int)
Post ID
$context(строка)
Context for how to sanitize the field. Accepts 'raw', 'edit', 'db', 'display', 'attribute', or 'js'.
По умолчанию: 'display'

Список изменений

С версии 2.3.0 Введена.

Где вызывается хук

sanitize_post_field()
post_menu_order
wp-includes/post.php 3164
$value = apply_filters( "post_{$field}", $value, $post_id, $context );

Где используется хук в WordPress

Использование не найдено.