Sometimes you might need to export extra data from a custom database table. This is possible by using a custom PHP function in the export along with the WPDB class.
For example, let’s say that we are exporting Users from a BuddyPress installation and we need to get the value of the “Name” field from the BuddyPress “Extended Profile” section: https://d.pr/6kZfA8. This information is stored inside the ‘bp_xprofile_data’ table: https://d.pr/CTdjb2. So, to export this, we’ll want to:
- Click “Add Field” in our export, keep “ID” in the top drop-down
- Name the field, for example “BuddyPress Name”
- Click “Export the value returned by a PHP function"
- Type in our function name, add the code to the function editor, and click “Done”.
Example video: https://drive.google.com/file/d/0BxSOi52PDCsAZ1JXazB0RzFFTnc/view?usp=sharing&resourcekey=0-OOnGF0Zes40Qqn6iEvFtIQ