Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_editable_roles [ WordPress Function ]

get_editable_roles ( No parameters )
Returns:
  • (unknown)
Defined at:



Fetch a filtered list of user roles that the current user is allowed to edit.

Simple function who's main purpose is to allow filtering of the list of roles in the $wp_roles object so that plugins can remove inappropriate ones depending on the situation or user making edits. Specifically because without filtering anyone with the edit_users capability can edit others to be administrators, even if they are only editors or authors. This filter allows admins to delegate user management.

Source


<?php
function get_editable_roles() {
    global 
$wp_roles;

    
$all_roles $wp_roles->roles;
    
$editable_roles apply_filters('editable_roles'$all_roles);

    return 
$editable_roles;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics