post_{$field}

FILTER wp-includes\post.php (ligne 3262) github
Filters the value of a specific post field for display. Only applied to post fields name which is *not* prefixed with `post_`. The dynamic portion of the hook name, `$field`, refers to the post field name. Possible filter names include:  - `post_ID`  - `post_comment_status`  - `post_ping_status`  - `post_to_ping`  - `post_pinged`  - `post_guid`  - `post_menu_order`  - `post_comment_count`

Paramètres

Entrée :
$value, $post_id, $context
Sortie :
@param mixed  $value   Value of the unprefixed post field.
@param int    $post_id Post ID
@param string $context Context for how to sanitize the field.

Utilisation

// Modifier la valeur avec le filtre 'post_{$field}'
add_filter('post_{$field}', 'ma_fonction_filtre', 10, 1);

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

Actualités

Chargement des actualités...