Listing all capabilities in dropdown is returning boolean

Solved with this Answer at Stack Overflow.

Each Array Key was the actual name of the capability […] You were searching for the capabilities by name, and since you were only seeing 1s in the output, I figured what you were looking for was in the keys.

foreach($capslist as $cap=>$caps){ 
    $dropdown .= '<option value="'.$cap.'">'.$cap.'</option>'; 
} 

Leave a Comment