Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I used a role editor recently and needed to delete a role. After deleting it I noticed that it began to appear as blank in the edit user role drop-down. After a bit of investigating and deleting entries from the database. I renabled more_fields and the blank boxes reappeared. I then did a db search and found multiple entries in wp_options more_fields as

a:12:{i:0;s:13:"administrator";i:1;s:6:"editor";i:2;s:6:"author";i:3;s:11:"contributor";i:4;s:10:"subscriber";i:5;s:11:"distributor";i:6;s:10:"integrator";i:7;s:5:"sales";i:8;s:7:"support";i:9;s:7:"revisor";i:10;s:7:"premier";i:11;s:9:"marketing";}

I've tried adjusting it back to wps default roles like the example below but it causes a 404.

a:5:{i:0;s:13:"administrator";i:1;s:6:"editor";i:2;s:6:"author";i:3;s:11:"contributor";i:4;s:10:"subscriber";}

Do I have my syntax correct or am I missing something else?

I've added the database entry to pastebin, you'll notice that the user role array is listed five times. Thanks for the help. http://pastebin.com/RpsFytgc

enter image description here

share|improve this question
    
Also, a user provided me with this example. Unfortunately, I don't have the original post to provide credit. seodenver.com/custom-rss-feed-in-wordpress –  Zach Shallbetter May 18 '11 at 19:48
    
have you tried using WordPress's builtin remove_role function? codex.wordpress.org/Function_Reference/remove_role –  aaronwaggs May 18 '11 at 21:32
    
Yeah I think that's what initially caused the problem. –  Zach Shallbetter May 18 '11 at 22:02

1 Answer 1

try :

a:5:{
s:13:"administrator";a:2:{s:4:"name";s:13:"Administrator";s:12:"capabilities";a:54:{s:13:"switch_themes";b:1;s:11:"edit_themes";b:1;s:16:"activate_plugins";b:1;s:12:"edit_plugins";b:1;s:10:"edit_users";b:1;s:10:"edit_files";b:1;s:14:"manage_options";b:1;s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:6:"import";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:8:"level_10";b:1;s:7:"level_9";b:1;s:7:"level_8";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;s:12:"delete_users";b:1;s:12:"create_users";b:1;s:17:"unfiltered_upload";b:1;s:14:"edit_dashboard";b:1;s:14:"update_plugins";b:1;s:14:"delete_plugins";b:1;s:15:"install_plugins";b:1;s:13:"update_themes";b:1;s:14:"install_themes";b:1;}}
s:6:"editor";a:2:{s:4:"name";s:6:"Editor";s:12:"capabilities";a:34:{s:17:"moderate_comments";b:1;s:17:"manage_categories";b:1;s:12:"manage_links";b:1;s:12:"upload_files";b:1;s:15:"unfiltered_html";b:1;s:10:"edit_posts";b:1;s:17:"edit_others_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:10:"edit_pages";b:1;s:4:"read";b:1;s:7:"level_7";b:1;s:7:"level_6";b:1;s:7:"level_5";b:1;s:7:"level_4";b:1;s:7:"level_3";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:17:"edit_others_pages";b:1;s:20:"edit_published_pages";b:1;s:13:"publish_pages";b:1;s:12:"delete_pages";b:1;s:19:"delete_others_pages";b:1;s:22:"delete_published_pages";b:1;s:12:"delete_posts";b:1;s:19:"delete_others_posts";b:1;s:22:"delete_published_posts";b:1;s:20:"delete_private_posts";b:1;s:18:"edit_private_posts";b:1;s:18:"read_private_posts";b:1;s:20:"delete_private_pages";b:1;s:18:"edit_private_pages";b:1;s:18:"read_private_pages";b:1;}}
s:6:"author";a:2:{s:4:"name";s:6:"Author";s:12:"capabilities";a:10:{s:12:"upload_files";b:1;s:10:"edit_posts";b:1;s:20:"edit_published_posts";b:1;s:13:"publish_posts";b:1;s:4:"read";b:1;s:7:"level_2";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;s:22:"delete_published_posts";b:1;}}
s:11:"contributor";a:2:{s:4:"name";s:11:"Contributor";s:12:"capabilities";a:5:{s:10:"edit_posts";b:1;s:4:"read";b:1;s:7:"level_1";b:1;s:7:"level_0";b:1;s:12:"delete_posts";b:1;}}
s:10:"subscriber";a:2:{s:4:"name";s:10:"Subscriber";s:12:"capabilities";a:2:{s:4:"read";b:1;s:7:"level_0";b:1;}}}

which are the roles and capabilities that are set by default.

share|improve this answer
    
Is this something I'll be able to do to the more_fields db entry? It's significantly different and occurs five times within it. pastebin.com/RpsFytgc –  Zach Shallbetter May 19 '11 at 16:32
    
The user role array is WordPress built-in data and not something generated by more fields. Look it up in the options database table. –  Bainternet May 19 '11 at 17:18
    
Interesting, I was pretty sure the reason I was seeing blank drop downs was because the data was being retained in the more_fields table. If I shut off all of the site's plugins, correct the table data with default data and then re-enable it. It re-applys all of the information back to user_role in wp_options and the role select appears blank. –  Zach Shallbetter May 19 '11 at 17:26
    
I think I now get what you were saying. The problem I was having was More Fields was creating custom roles and overriding WordPress's roles. I fixed this by downloading Justin Tadlock's member's plugin and remade all of the roles. I'm still unable to delete them but its better than an empty dropdown. I read your reference on this post and it clarified what you were saying here. wordpress.stackexchange.com/questions/23054/… –  Zach Shallbetter Jul 28 '11 at 18:22
    
Glad to hear you got it. –  Bainternet Jul 28 '11 at 18:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.