WP HOOKS
akcjadynamicznyod 5.1.0

edit_post_{$post->post_type}

Args 2Plik wp-includes/post.php

Opis — z kodu źródłowego

Fires once an existing post has been updated.

The dynamic portion of the hook name, $post->post_type, refers to the post type slug. Possible hook names include:

  • edit_post_post
  • edit_post_page

Hook dynamiczny — możliwe nazwy

edit_post_pageedit_post_post

Parametry

ParametrTypOpis
$post_idintPost ID.
$post\WP_PostPost object.

Wywołanie

Rejestracja callbackaphp
// rejestracja funkcji zwrotnej — podaj liczbę argumentów!
add_action( 'edit_post_{$post->post_type}', 'twoja_funkcja', 10, 2 );

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

Popularne w tej kategorii