rest_comment_trashable

FILTER wp-includes\rest-api\endpoints\class-wp-rest-comments-controller.php (ligne 1052) github
Filters whether a comment can be trashed via the REST API. Return false to disable trash support for the comment.

Paramètres

Entrée :
( EMPTY_TRASH_DAYS > 0
Sortie :
@param bool       $supports_trash Whether the comment supports trashing.
@param WP_Comment $comment        The comment object being considered for trashing support.

Utilisation

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

function ma_fonction_filtre(( EMPTY_TRASH_DAYS > 0) {
    // Modifier la valeur
    return ( EMPTY_TRASH_DAYS > 0;
}

Actualités

Chargement des actualités...