Home › Forum › Amministrazione WP › Filtrare articoli in dashboard
-
AutorePost
-
-
23 Novembre 2010 alle 0:41 #15729giangel84Partecipante
Sto cercando ormai disperatamente un consiglio per filtrare gli articoli a seconda del livello dell’utente collegato.
Gestisco già le varie capacità degli utenti in modo soddisfacente tramite Capability Manager, ma vorrei fare in modo di aggiungere un filtro.
In pratica quando un utente accede alla pagina degli articoli, edit.php, vorrei che SE l’utente collegato è un editore:
1) Possa vedere nella lista “Tutti”, “Pubblicati”, “Bozze” e “Cestinati” TUTTI I POST il cui autore è SOLO se stesso E TUTTI I POST di cui esso è editore.
2) Nella lista “In attesa di revisione” dovrebbe poter vedere TUTTI GLI ARTICOLI in status “pending”.
Il punto numero (1) lo ottengo (in modo parziale) creando un plugin in questo modo:
function filtro( $wp_query ) {
if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/edit.php' ) !== false ) {
global $current_user;
get_currentuserinfo();
if (($current_user->user_level) == 7) {
$wp_query->set( 'author', $current_user->id );
}
}
}
add_filter('parse_query', 'filtro');
Purtroppo però non sono in grado di fare in modo che l'utente possa vedere TUTTI I POST di cui esso è editore.
Inoltre tale funzione purtroppo fa in modo che nella lista dei post "In attesa di revisione" vengano fuori solo quelli di cui esso è autore...io invece voglio che li possa vedere TUTTI.
Come si può fare?
Ho provato a studiarmi le funzioni ma non ne vengo a capo.
Grazie a tutti.
-
25 Novembre 2010 alle 4:46 #78922giangel84Partecipante
Ho trovato la soluzione e mi sono scritto un plugin…
-
12 Aprile 2011 alle 16:26 #83287GRlabPartecipante
Ho trovato la soluzione e mi sono scritto un plugin…
…io sto cercando qualcosa del genere per…..
1: Limitare la creazione dei post da parte degli autori ? Io vorrei dare la possibilità di fare creare un numero dei post a seconda del livello dell’user?
2: Vorrei inoltre usare per la creazione del post tramite front-end e non nel admin
3: Inoltre vorrei filtrare la visualizzazione degli articoli da parte degli author, ovvero devono visualizzare solo l’articolo/i che hanno creato il singolo utente
Grazie del supporto
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.