Problems with WordPress user levels
-
Hi Roland
I’ve contacted you a few times about creating a new record within PDB and the fields being empty. I’m using the following routine
$current_user = wp_get_current_user();
$wp_username = $current_user->user_login;
$data=array(‘username’ => $wp_username);
Participants_Db::write_participant($data);The above routine created a record with PDB, but I just could not understand why sometimes the fields were empty and other times they were full.
The penny has finally dropped…
The routine only works correctly if I’m logged in as an administrator. If I log in as a Subscriber, Contributor or Author and run the routine, it will create the record but the fields are empty.
I’ve been through the various access levels within WordPress and the only other user level that allows my routine to work correctly is Editor.
So the question is, is there some additional code or command I need to add in order to allow Subscribers to run the routine correctly and fill the fields as required. Obviously I don’t want to give them Editor level.
Many Thanks
The topic ‘Problems with WordPress user levels’ is closed to new replies.