Home > front end >  ARMember: Hook to Change Form Field value
ARMember: Hook to Change Form Field value

Time:09-01

How do I change the case/value of an ARMember form field before it creates the subscriber ?

I can make the desired changes in $posted_data which is passed to the various hooks tried, but the changes did not persist outside of my_function.

Tried global $posted_data in my_function and &$posted_data in my_function passed parameters.

It must be something simple. Thanks.

CodePudding user response:

Digging through the code I discovered an undocumented Filter which works.

add_filter ( 'arm_before_member_register', 'your_before_member_register', 10, 1 );

function your_before_member_register ( $posted_data ) {

   $posted_data['first_name'] =  ucwords($posted_data['first_name']);
   $posted_data['last_name']  =  ucwords($posted_data['last_name']);

   // Register user with proper case: First, Last and Display names

   return ( $posted_data );  
}
  • Related