Last active
September 17, 2018 01:11
-
-
Save radarin/f1cdd593cd81411d662f97f73f95149c to your computer and use it in GitHub Desktop.
Wordpress Beiträge nach Autoren anzeigen
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function rudr_filter_by_the_author() { | |
$params = array( | |
'name' => 'author', // das ist das "name" attribute für den Filter | |
'show_option_all' => 'Alle Autoren' // Anzeige für 'Alle Autoren' (Anzeige, wenn kein Filter gewählt) | |
); | |
if ( isset($_GET['user']) ) | |
$params['selected'] = $_GET['user']; // Autor mit der Variablen $_GET auswählen | |
wp_dropdown_users( $params ); // Zeit Beiträge des Autoren an | |
} | |
add_action('restrict_manage_posts', 'rudr_filter_by_the_author'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment