wp_insert_post_parent

FILTER wp-includes\post.php (ligne 4777) github
Filters the post parent -- used to check for and prevent hierarchy loops.

Paramètres

Entrée :
$post_parent, $post_id, $new_postarr, $postarr
Sortie :
@param int   $post_parent Post parent ID.
@param int   $post_id     Post ID.
@param array $new_postarr Array of parsed post data.
@param array $postarr     Array of sanitized, but otherwise unmodified post data.

Utilisation

// Modifier la valeur avec le filtre 'wp_insert_post_parent'
add_filter('wp_insert_post_parent', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($post_parent) {
    // Modifier la valeur
    return $post_parent;
}

Actualités

Chargement des actualités...