filtrod 0.71
the_excerpt
Opis
Filtruje zajawkę wpisu przy wyświetlaniu.
Przykład użycia
add_filter( 'the_excerpt', ... )php
add_filter( 'the_excerpt', 'wpdocs_excerpt_read_more' );
function wpdocs_excerpt_read_more( $excerpt ) {
return $excerpt . ' <a href="' . esc_url( get_permalink() ) . '">' . esc_html__( 'Czytaj dalej', 'wpdocs' ) . ' →</a>';
}
add_filter( 'the_excerpt', 'wpdocs_excerpt_read_more' );
function wpdocs_excerpt_read_more( $excerpt ) {
return $excerpt . ' <a href="' . esc_url( get_permalink() ) . '">' . esc_html__( 'Czytaj dalej', 'wpdocs' ) . ' →</a>';
}Parametry
| Parametr | Typ | Opis |
|---|---|---|
$post_excerpt | string | The post excerpt. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej
add_filter( 'the_excerpt', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}
// rejestracja funkcji zwrotnej
add_filter( 'the_excerpt', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}Popularne w tej kategorii