WP HOOKS
filtrdynamicznyod 3.6.0

_wp_post_revision_field_{$field}

Args 4Plik wp-admin/includes/revision.php

Opis — z kodu źródłowego

Contextually filter a post revision field.

The dynamic portion of the hook name, $field, corresponds to a name of a field of the revision object. Possible hook names include:

  • _wp_post_revision_field_post_title
  • _wp_post_revision_field_post_content
  • _wp_post_revision_field_post_excerpt

Hook dynamiczny — możliwe nazwy

_wp_post_revision_field_post_content_wp_post_revision_field_post_excerpt_wp_post_revision_field_post_title

Parametry

ParametrTypOpis
$revision_fieldstringThe current revision field to compare to or from.
$fieldstringThe current revision field.
$compare_from\WP_PostThe revision post object to compare to or from.
$contextstringThe context of whether the current revision is the old or the new one. Either 'to' or 'from'.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( '_wp_post_revision_field_{$field}', 'twoja_funkcja', 10, 4 );

function twoja_funkcja($param_1, $param_2, $param_3, $param_4) {
	// Twój kod
}

Popularne w tej kategorii