lauge500
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Hello there, sorry for late response.
I am using the custom {approve_link} in thenotification_review.php
Here is a snippet of the code. Nothing more is being edited.
@champsupertramp1) Creating the approve user action.
add_action("wp_ajax_approve_user", "approve_user"); add_action("wp_ajax_nopriv_approve_user", "approve_user"); function approve_user() { $user_id = intval($_GET['user_id']); um_fetch_user( $user_id ); UM()->user()->approve(); echo "<h2>User successfully approved.</h2>"; wp_die(); }
2) Adding the custom placeholder
add_filter( 'um_template_tags_patterns_hook', 'my_template_tags_patterns', 10, 1 ); add_filter( 'um_template_tags_replaces_hook', 'my_template_tags_replaces', 10, 1 ); function my_template_tags_patterns( $search ) { $search[] = '{approve_link}'; return $search; } function my_template_tags_replaces( $replace ) { $replace[] = get_home_url() . '/wp-admin/admin-ajax.php?action=approve_user&user_id=' . um_user( 'ID' ); return $replace; }
How is it a bug with my custom code?
All my code does approving users through the UM Codex “approve” action.
And then the UM email gets send with an invalid link. I don’t see it ??
But thank for the very quick answer!
@champsupertramp
Viewing 3 replies - 1 through 3 (of 3 total)