Special characters in social media urls

[ad_1]

@masini2002

If you enter the link with % characters as above WP will omit these characters.
Browser “copy link” will give you these % characters, try to use “copy”.
With the real characters from a browser “copy” the link will work OK.

@masini2002

You can try this code snippet which will decode the % characters
so both browser “copy” and “copy link” will work for Linkedin.

add_filter( 'um_submit_post_form', 'um_submit_post_form_rawurldecode', 10, 1 );

function um_submit_post_form_rawurldecode( $post_form ) {

    $index = 'linkedin-' . $post_form['form_id'];
    if ( isset( $post_form[$index] )) {
        $post_form[$index] = rawurldecode( $post_form[$index] );
    }
    return $post_form;
}

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

Thanks, the code provided solves the problem. Thank you very much for the support.

 

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