den1sa
Forum Replies Created
-
I managed to integrate this code and it now sets a new user to Pending Review, but for some reason it is also setting the admin user to Pending Review.
How can i prevent the admin user from being changed to Pending Review?
function my_pmprorh_init() { if ( ! function_exists( 'pmprorh_add_registration_field' ) ) { return false; } // Define the fields. $fields = array(); $fields[] = new PMProRH_Field( 'talent_categories', // input name, will also be used as meta key 'select', // type of field array( 'required' => true, // make this field required 'profile' => false, // do not only show in profile for admins 'levels' => array(6), 'label' => 'What type of talent are you registering?', // custom field label 'options' => array( // <option> elements for select field '' => 'Please select talent type', // blank option - cannot be selected if this field is required 'Model' => 'Model', // <option value="1</option> 'Actors' => 'Actors', // <option value="2</option> 'Dancers' => 'Dancers', // <option value="3</option> ) ) ); // ADDED HERE um_fetch_user( $user_id ); UM()->user()->pending(); // Add the fields into a new checkout_boxes are of the checkout page. foreach ( $fields as $field ) { pmprorh_add_registration_field( 'checkout_boxes', // location on checkout page $field // PMProRH_Field object ); } // That's it. } add_action( 'init', 'my_pmprorh_init' );
I found the pmp webhooks, but i really do not know what to do with them.
https://www.paidmembershipspro.com/hooks-filters/
- This reply was modified 2 years, 9 months ago by den1sa.
Hi Miss Veronica,
Thank you but unfortunately this didn’t work. Although I am using Ultimate Member for the member pages, I am using Paid Membership Pro for the registration. I think the same needs to be done with Paid Membership Pro as the trigger and not Ultimate Member. This looks so close to the solution.
I need Paid Membership Pro to set the Ultimate Member status to Review Pending when a user registers.
I hope you can help.
Thanks,
Denis
Thank you for your prompt response. I will try this now.
Sorry I did t see your reply. Do you know what payment plug-in will allow me to use the UM registration form so I can capture custom data?
Restrict Content Pro?
Paid membership Pro?
WooCommerce subscriptions?
UM Switcher?Thanks.
Thanks Champ.
Worked like a charm.
BUMP!
Can anyone help?
I suppose the ideal is;
If Birth Date is 18th Oct 2019 then should appear as 18 months old.
If 2 years old or over then it appears as normal years.Thanks in advance.
Denis
- This reply was modified 3 years, 10 months ago by den1sa.
Back to the original code. I have just tried to make a slight amendment so that months are displayed for under 2 year olds. But unfortunately this code doesn’t seem to recognize the year of birth and bases the age on the current year.
So, D.O.B. = 1st Nov 2019 shows 5 months old.
I amended this part only.
if ( $age >= 2 ) { return $value; } if ( $age < 2 ) {
See code below.
add_filter( 'um_profile_field_filter_hook__date', 'um_041921_profile_field_filter_hook__date', 89, 2 ); function um_041921_profile_field_filter_hook__date( $value, $data ) { if ( ! $value ) { return ''; } $then_ts = strtotime( $value ); $then_year = date( 'Y', $then_ts ); $age = date( 'Y' ) - $then_year; if ( strtotime( '+' . $age . ' years', $then_ts ) > current_time( 'timestamp' ) ) { $age--; } if ( $age >= 2 ) { return $value; } if ( $age < 2 ) { $month = date("n", strtotime( $value ) ); $datetime1 = date_create( date("Y-m-d", strtotime( $value ) ) ); $datetime2 = date_create( date("Y-m-d", current_time( 'timestamp' ) ) ); $interval = date_diff($datetime1, $datetime2); remove_filter( 'um_profile_field_filter_hook__date', 'um_profile_field_filter_hook__date', 99, 2 ); $month = $interval->format("%m"); return sprintf("%d ",(int)$month)._n( 'month old', 'months old', (int)$month, 'ultimate-member' ); } return $value; }
Now. On the age selection filter for searches, how can I search for registered users say between 3 to 6 months old?
- This reply was modified 3 years, 10 months ago by den1sa.
Hi Champ.
I used Code Snippet to insert this code. Thank you.
It worked!
Denis
- This reply was modified 3 years, 10 months ago by den1sa.
Hi Champ,
Do you have an example of what this would look like?
Denis
Hi,
Thank you for your response.
Its not the members that I am focusing on, its the member. Each member should have a table like view of training courses attended sorted in the order of date.
I am hoping someone has addressed this list based function and may be able to offer some advice on how to achieve it.
Denis
- This reply was modified 4 years, 1 month ago by den1sa.
Hi Asif,
This is what I am asking. I am hoping there is a plug-in that integrates with UM to allow this functionality.
Denis