• Resolved Cristiano

    (@cristiano)


    I need to redirect the cookpro profile image link to the Ultimate member profile.

    On my site I also use the wpforo with the ultimate member.
    The team of Wpforo gave me this code below, that by clicking on the photo and profile name of wpforo redirects to the Ultimate Member

    Can you help me?

    function change_wpforo_profile_to_um_url( $url = '', $member = array(), $template = 'profile' ){
        if( wpfval($member, 'ID') && function_exists('um_fetch_user') && function_exists('um_user_profile_url') ){
            um_fetch_user( $member['ID'] );
            $user_domain = um_user_profile_url();
            if( $user_domain ){
                return $user_domain;
            }
        }
        return $url;
    }
    add_filter( 'wpforo_member_profile_url', 'change_wpforo_profile_to_um_url', 10, 3 );
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Boxy Studio

    (@boxystudio)

    You’re in luck!

    Cooked provides a filter for this:

    'cooked_author_permalink'

    Here’s what you can do:

    add_filter( 'cooked_author_permalink', 'custom_cooked_author_permalink', 10, 2 );
    function custom_cooked_author_permalink( $permalink, $author_id ){
        if( function_exists('um_fetch_user') && function_exists('um_user_profile_url') ){
            um_fetch_user( $author_id );
            $um_profile_url = um_user_profile_url();
            if( $um_profile_url ){
                return $um_profile_url;
            }
        }
        return $permalink;
    }

    Let me know if that works!

    • This reply was modified 6 years, 6 months ago by Boxy Studio. Reason: Code update
    Thread Starter Cristiano

    (@cristiano)

    It worked perfectly, thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Cooked and Ultimate Member’ is closed to new replies.