Viewing 2 replies - 1 through 2 (of 2 total)
  • @themedutch

    You can try this code snippet for replacing http: with https: in an UM field.
    Change my_http to your meta_key name

    add_filter( 'um_before_update_profile', 'um_before_update_profile_https_url', 999, 2 );
    function um_before_update_profile_https_url( $changes, $user_id ) {
    
        $key = 'my_http';
        if ( isset( $changes[$key] ) && ! empty( $changes[$key] )) {
            if ( substr( $changes[$key], 0, 5) == 'http:' ) {
                $changes[$key] = str_replace( 'http:', 'https:', $changes[$key] );
            }
        }
        return $changes;
    }

    Install the code snippet into your active theme’s functions.php file
    or use the “Code Snippets” plugin.

    https://ww.wp.xz.cn/plugins/code-snippets/

    Plugin Support andrewshu

    (@andrewshu)

    Hi @themedutch

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread if any other questions come up and we’d be happy to help. 🙂

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘How to force HTTPS instead of HTTP on a profile website field’ is closed to new replies.