WP HOOKS
filtrod 5.1.0

pre_wp_unique_post_slug

Args 6Plik wp-includes/post.phpDokumentacja WP ↗

Opis — z kodu źródłowego

Filters the post slug before it is generated to be unique.

Returning a non-null value will short-circuit the unique slug generation, returning the passed value instead.

Parametry

ParametrTypOpis
$override_slugstring | nullShort-circuit return value.
$slugstringThe desired slug (post_name).
$post_idintPost ID.
$post_statusstringThe post status.
$post_typestringPost type.
$post_parentintPost parent ID.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_filter( 'pre_wp_unique_post_slug', 'twoja_funkcja', 10, 6 );

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

Popularne w tej kategorii