Map Additional Field
-
Hello,
Thanks for the work on this great plugin. It is working really well.I am in the process of looking over your code in order to hack in an additional field for the Database Table Mapping. I would like to map an additional field in the remote database to the nickname Meta Key inside wp_usermeta. The nickname field is an important field in WordPress. In my case we are using the Dokan Vendor plugin for Woocommerce and it uses the nickname Meta Key to assign the name of a vendor’s store in the URI. Like this: storedomain.com/cart/store/nickname/
So when a user is created with your plugin after logging into a WordPress website, your plugin misses writing the nickname field in wp_usermeta. So, this requires manually editing this in the database in order for the Vendor store to work.Here’s what I have found so far looking over your code:
There are several PHP files in your plugin that have a data array for each mapped key and what appears to be a file to handle the insert statements to the database. These are:
1. BuiltPluginData.php
2 Exlog_built_plugin_data.php
3. options_fields.php
4. db.php (handles the inserts)Am I okay to add an additional arrays to the first three files with my desired field like this:
array( "field_name" => "Nickname Vendor Cart Field Name", "field_description" => "This is the name of the field that stores your vendors store name in the URL path. It MUST be unique.", "field_slug" => "exlog_dbstructure_nickname", "type" => "text", "required" => true )
And in the db.php file add the code below about line 68 inside the $data = array(). Like this:
"dbstructure_nickname" => exlog_get_option('exlog_dbstructure_nickname'),
And also in the db.php file add the code below about line 92 inside the exlog_build_wp_user_data() method. Like this:
"nickname" => $userData[$db_data["dbstructure_nickname"]],
So, my question to you is have I found everything required. I could just pull the trigger and test it, but I was hoping to get some feedback before possibly making an error writing to the user table of a the site.
Thanks for any input you can offer and thank you so much for building this plugin.
- The topic ‘Map Additional Field’ is closed to new replies.