PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Profile Edit Timing

s2Member Plugin. A Membership plugin for WordPress®.

Profile Edit Timing

Postby martonic » July 30th, 2010, 9:14 pm

Hi Jason,

I ran into something annoying. There may be nothing you can do about it, but here it is.

I entered a hook for "profile_update" to catch profile changes and update my account tables.

The trouble is that when this runs, any edits to "s2Member Custom Fields" have not yet been recorded to the database, and there seems to be no context in which they are available (the hook sends a user ID # and that's all). Regular changes (i.e. first name, last name, email) have been recorded and are available when the hook gets invoked.

Like I said, there's probably nothing you can do, but at least now you know about this issue.
User avatar
martonic
Experienced User
Experienced User
 
Posts: 70
Joined: July 14, 2010

Re: Profile Edit Timing

Postby Jason Caldwell » August 5th, 2010, 3:48 pm

Thanks for reporting this. I'll take a look to see what's possible.

@R/TODO :: profile editing hooks; availability of changed variables

Just to note. You will be updated automatically as these TODO items are addressed.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Profile Edit Timing

Postby Jason Caldwell » August 10th, 2010, 3:18 pm

@RESOLVED/TODO :: profile editing Hooks.
After investigation, it seems that you're relying solely on the "profile_update" Hook.

Possible solutions for you:

1. See: /s2member/includes/functions/profile-modifications.inc.php
add_action("ws_plugin__s2member_after_handle_profile_modifications", "your_function");

2. Set your "profile_update" Hook with a lower priority than the default of 10 ( timing issue maybe ).

3. See: /s2member/includes/functions/users-lists.inc.php
There are some other Hooks provided by s2Member here that are related to admin panel updates.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Profile Edit Timing

Postby martonic » August 10th, 2010, 6:59 pm

Hi Jason,

After trying several things, the following worked:

Code: Select all
    $hook = "profile_update";
    add_action($hook, "catch_profile_edit", 20);


(higher priority number = lower priority = runs later)

Thanks! :mrgreen:
User avatar
martonic
Experienced User
Experienced User
 
Posts: 70
Joined: July 14, 2010

Re: Profile Edit Timing

Postby Jason Caldwell » August 17th, 2010, 11:35 am

Thanks for reporting back on this.
Much appreciated.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 13 guests

cron