WP HOOKS
filtrdynamicznyod 2.3.0

pre_{$field}

Args 1Plik wp-includes/post.php

Opis — z kodu źródłowego

Filters the value of a specific post field before saving.

Only applied to post fields with a name which is prefixed with post_. The dynamic portion of the hook name, $field, refers to the post field name. Possible filter names include:

  • pre_post_author
  • pre_post_date
  • pre_post_date_gmt
  • pre_post_content
  • pre_post_title
  • pre_post_excerpt
  • pre_post_status
  • pre_post_password
  • pre_post_name
  • pre_post_modified
  • pre_post_modified_gmt
  • pre_post_content_filtered
  • pre_post_parent
  • pre_post_type
  • pre_post_mime_type

Parametry

ParametrTypOpis
$valuemixedValue of the post field.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej
add_filter( 'pre_{$field}', 'twoja_funkcja' );

function twoja_funkcja($param_1) {
	// Twój kod
}

Popularne w tej kategorii