Cannot redeclare um_user_after_updating_profile() Error | WordPress.org

[ad_1]

Hi!

I’m having trouble with my code.
PHP Fatal error: Cannot redeclare my_user_after_updating_profile() (previously declared in “path”:566 in “path” on line 566″

Context: On the user’s accounts page, there are several checkbox roles they can assign themselves. After submission, my code assigns all roles to the users, then removes ones that were not included in the checkboxes. It achieves this by converting the array into a string and searching the string for that role.

I get this error after submission, however the code successfully runs, but it breaks.

I’m struggling to understand where this is looping back around.
Code is below.


add_action( 'um_user_after_updating_profile', 'my_user_after_updating_profile', 10, 2 ); 
function my_user_after_updating_profile( $userinfo, $user_id ) {
//my code
}
do_action( 'um_user_after_updating_profile', $to_update, $user_id, $args );

Can someone help?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer