User Role (wp_capabilities) mapping correct formatting
-
I am trying to map a custom (picklist) field from Salesforce to WordPress User Role field (wp_capabilities).
I know the User Role on WordPress’s side uses the wp_capabilities field in the mapping drop down, and in the WordPress database I have found that the formatting of the data needs to be “serialized” – one of my rolls for example is listed as “a:1:{s:11:”boardmember”;b:1;}” in the WordPress database (specifically the wp_usermeta table, meta_value field).
In Salesforce I have set up a picklist with the different user rolls, and they use simple text in the data that gets sent from Salesforce to WordPress. Examples – “boardmember” or “report_member”
When the data gets sent to WordPress it is sent to the correct field in the database, it just doesn’t format the data correctly in the “serial” format. So, WordPress lists “No role for this site” in the User Role field on the front end. In the database I can see the example entry as plain text “boardmember” listed for wp_capabilities.
I have tried setting up the “serialized” version of the data as the data that gets sent from Salesforce – for example I set the data that gets sent as “a:1:{s:11:”boardmember”;b:1;}” (without the first and last quotes) – but when WordPress receives it, it adds extra serial data it so in the database it shows “s:29:\”a:1:{s:11:”boardmember”;b:1;}\”;”
I am looking for help to get the correct formatting that I need to add to Salesforce in order for WordPress to receive the data and list it properly in the database. Or, are there settings I need to change in WordPress, or the Object Sync for Salesforce plugin to accommodate the communication of the User Role data in the correct format?
Thank you for any help.
- The topic ‘User Role (wp_capabilities) mapping correct formatting’ is closed to new replies.