Community Support Forums — WordPress® ( Users Helping Users ) — 2012-02-06T15:05:33-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=17107 2012-02-06T15:05:33-05:00 http://www.primothemes.com/forums/viewtopic.php?t=17107&p=62330#p62330 <![CDATA[Re: Change profile custom fields values]]> Thanks for the heads up on this thread.

I would suggest this article to you as a primer as Hooks/Filters for WordPress.
http://codex.wordpress.org/Plugin_API#H ... our_Filter

The reason you're getting an empty array is because you're only requesting one function argument.

Try it like this please.
Code:
add_filter ("ws_plugin__s2member_during_profile_during_fields_display_custom_fields", "my_function", 10, 2);
function my_function ($bool, $vars = array ())
    {
        var_dump($vars);
      return $vars;
    } 

Statistics: Posted by Jason Caldwell — February 6th, 2012, 3:05 pm


]]>
2012-02-01T08:49:37-05:00 http://www.primothemes.com/forums/viewtopic.php?t=17107&p=62090#p62090 <![CDATA[Re: Change profile custom fields values]]> Since I need to alter values in variables it seems that I must use filters. I tried this code:

Code:
add_filter ("ws_plugin__s2member_during_profile_during_fields_display_custom_fields", "my_function");
function my_function ($bool, $vars = array ())
    {
        var_dump($vars);
      return $vars;
    }


So I discovered that in all filter hooks I only get empty array as $vars:
Code:
array(0) { }
Therefore what is the purpose of these filters?

In actions it is true, I get a lot of things inside $vars variable but how to handle them? Specifically what can I do to save a certain value to a certain custom field inside an action?

Statistics: Posted by rvencu — February 1st, 2012, 8:49 am


]]>
2012-02-01T05:29:51-05:00 http://www.primothemes.com/forums/viewtopic.php?t=17107&p=62085#p62085 <![CDATA[Re: Change profile custom fields values]]> Statistics: Posted by rvencu — February 1st, 2012, 5:29 am


]]>
2012-01-31T18:35:07-05:00 http://www.primothemes.com/forums/viewtopic.php?t=17107&p=62045#p62045 <![CDATA[Re: Change profile custom fields values]]>
This thread may be useful: viewtopic.php?f=4&t=16594#p59823

Statistics: Posted by Raam Dev — January 31st, 2012, 6:35 pm


]]>
2012-01-31T15:13:26-05:00 http://www.primothemes.com/forums/viewtopic.php?t=17107&p=62017#p62017 <![CDATA[Change profile custom fields values]]>
I can generate in PHP the required value. How do I interact with the profile updates?

I found several hooks but have no idea how to change the value captured from the form into the custom value I calculate for the custom field.

Statistics: Posted by rvencu — January 31st, 2012, 3:13 pm


]]>