latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

filter not getting defined vars

Home Forums Community Forum filter not getting defined vars

This topic contains 2 replies, has 2 voices. Last updated by  Santi Azpilicueta 4 years, 10 months ago.

Topic Author Topic
Posted: Sunday Feb 19th, 2012 at 7:41 am #5641

Hi Jason and all,

Sorry for asking what would be a programming question, but I do not know where else to go at this point…

I am trying to pass custom Registration Fields to Aweber (thru ws_plugin__s2member_aweber_msg filter, but get_defined_vars is not working as expected. The $vars output from

add_filter('ws_plugin__s2member_aweber_msg','add_to_aweber_msg');

function add_to_aweber_msg($original_value, $vars = array() )
{
return ($original_value . "nn" . var_export($vars, true));
}

is an empty array.

Surprisingly, if I append the supposedly sameget_defined_vars to the first paramater of the correspoding ws_plugin__s2member_aweber_msg apply_filters at http://www.s2member.com/codex/stable/source/s2member/includes/classes/list-servers.inc.php/#src_doc_line_156, I get a bunch of variables, (not custom fields, mind you, but I could get them otherwise with get_user_field

Any help will be greatly appreciated, I am pulling out my hair at this point.

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Monday Feb 20th, 2012 at 7:24 pm #5761
Staff Member

Hi there. You'll just need to request the additional parameters in your add_filter() call please.

add_filter('ws_plugin__s2member_aweber_msg','add_to_aweber_msg', 10, 2);

See also: http://codex.wordpress.org/Function_Reference/add_filter

Posted: Monday Feb 20th, 2012 at 7:52 pm #5768

Yeah, I suspected it had to be something that simple…

Thanks a bunch, Jason! You are awesome.

Viewing 2 replies - 1 through 2 (of 2 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.