Support » Plugins » Replace space with   in shortcode result

  • Hi.
    I’m have added a shortcode to a plugin for users to use and insert the blog name in a pre-styled format throughout the website:

    Code so far (working):

    function dos_cname_function() {
    	$i = get_bloginfo('name');
        return '<span class="dos_cname">' . $i . '</span>';
    add_shortcode('dos_cname', 'dos_cname_function');

    I’ve searched around to see if there is any way to add a function to replace any spaces in the blog name with   but haven’t been successful.

    In other words, when the shortcode retrieves get_bloginfo(‘name’) and displays the result it will be “My Company Name” instead of “My Company Name”.

    Does anyone have any thoughts on how to achieve this (if possible)?


  • The topic ‘Replace space with   in shortcode result’ is closed to new replies.