edit_{$post_type}_per_page

FILTER wp-admin\includes\post.php (ligne 1292) github
Filters the number of items per page to show for a specific 'per_page' type. The dynamic portion of the hook name, `$post_type`, refers to the post type. Possible hook names include:  - `edit_post_per_page`  - `edit_page_per_page`  - `edit_attachment_per_page`

Paramètres

Entrée :
$posts_per_page
Sortie :
@param int $posts_per_page Number of posts to display per page for the given post

Utilisation

// Modifier la valeur avec le filtre 'edit_{$post_type}_per_page'
add_filter('edit_{$post_type}_per_page', 'ma_fonction_filtre', 10, 1);

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

Actualités

Chargement des actualités...