Posted: August 1, 2016 at 12:19 pm
|
I am using the EE WP User Integration Plugin. However, I need additional personal information to be stored for the registered user in the wp-user oder user-meta. I know how to add additional questions etc. But those are obviously not stored. What do you suggest to add additional fields and store them in the newly created wp-user (wp-user meta)? |
Hello, You will have to develop a custom integration to make this happen. You might want to look at the EE4 Model System. There’s a section about storing meta information here. If you want, you could build an add-on for this feature using our EE4 Add-on API. If you have any developer related questions, please feel free to create a new issue via the EE4 Github page. |
|
|
Thanks for the info. |
You’ll look in EED_WP_Users_SPCO.module.php, in the process_wpuser_for_attendee() method. |
|
|
Great Josh. I found the function I was looking for. Let’s say I want to modify the public static function process_wpuser_for_attendee. What would be the best way to do it, instead of just directly hacking the plugin file? |
You use the hooks inside that method, or unhook the method (with remove_action()) so it doesn’t run and replace with your own custom function based on that method (with add_action()). See also: |
|
|
Great information. However, it is not working yet. I reduced the priority to 11, because in EE the hook is added with prio 10. It needs to be added before it can be removed, right? I also added the global class variable But it still does not work. Do I need to add anything else? |
|
Apart from that, could you tell me what kind of data structure the $valid_data is? According to the description: $valid_data The incoming form post data (that has already been validated). That what $valid_data contains:
|
It’s also important when your remove_action call is executed. There’s an example in our code snippet repository:
It’s a serialized array. |
|
|
I copied it 1:1 from your example and still it does not work. Besides, when looking at the code you linked. It looks like there is something not wrong. The linked functions do not exist/have a different name. Here is the corrected code for my version. As far as the function content is concerned, I just copied the code from EED_WP_Users_SPCO.module.php 1:1. But it is not working. What am I doing wrong? |
I don’t know what you’re doing wrong, but you should be able to figure this out since you’re able to point out where the example code is wrong. Thanks for pointing that out! |
|
|
Unfortunately, I am unable to figure it out. 1) I created plugin and activated it. I copied the exactly the code from your link into it the plugin file. 2) I removed all the code inside the main function ‘jf_ee_process_wpuser_for_attendee’ and replaced it with the original code from the same function ‘process_wpuser_for_attendee’ from the EED_WP_Users_SPCO.module.php 3) Theoretically, the only thing this plugin in does is remove the original EE hook and add my own hook. The code is exactly the same and it should behave exactly the same. When the plugin is deactivated and the original EE hook is used. The process works. A user is created based on the attendee information. Why does it throw the error although the processed code is exactly the same? |
That it is… but it is now outside the EED_WP_Users_SPCO class, which means the you can not use any of the classes protected methods, which the default function does.
Is a protected method, you can not access that method from outside of the class. One way around that is to add the code from the protected method into the code you are using, take a look at how Joshes example does that: |
|
Because there’s a private method in your hooked function, which is visible in its own class only |
|
|
BAM! I knew you would find the issue. Solved. Jumpinh right onto the next issue. 😀 |
The support post ‘Upon registration create user and store all registration fields in user-meta’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.