the_password_form хук-фильтрWP 2.7.0

Filters the HTML output for the protected post password form.

If modifying the password field, please note that the WordPress database schema limits the password field to 255 characters regardless of the value of the minlength or maxlength attributes or other validation that may be added to the input.

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

add_filter( 'the_password_form', 'wp_kama_the_password_form_filter', 10, 3 );

/**
 * Function for `the_password_form` filter-hook.
 * 
 * @param string  $output           The password form HTML output.
 * @param WP_Post $post             Post object.
 * @param string  $invalid_password The invalid password message.
 *
 * @return string
 */
function wp_kama_the_password_form_filter( $output, $post, $invalid_password ){

	// filter...
	return $output;
}
$output(строка)
The password form HTML output.
$post(WP_Post)
Post object.
$invalid_password(строка)
The invalid password message.

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

С версии 2.7.0 Введена.
С версии 5.8.0 Added the $post parameter.
С версии 6.8.0 Added the $invalid_password parameter.

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

get_the_password_form()
the_password_form
wp-includes/post-template.php 1833
return apply_filters( 'the_password_form', $output, $post, $invalid_password );

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

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