wp_save_post_revision_post_has_changed

FILTER wp-includes\revision.php (ligne 208) github
Filters whether a post has changed. By default a revision is saved only if one of the revisioned fields has changed. This filter allows for additional checks to determine if there were changes.

Paramètres

Entrée :
$post_has_changed, $latest_revision, $post
Sortie :
@param bool    $post_has_changed Whether the post has changed.
@param WP_Post $latest_revision  The latest revision post object.
@param WP_Post $post             The post object.

Utilisation

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

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

Actualités

Chargement des actualités...