title: Change/insert characters in URL
body: <p>I've been learning a lot of stuff as I go today, so hopefully, this question is clear. I have the below code which shows all posts written by the logged-in user as long as the post is a specific category. The part I'm trying to change is the URL. The goal is to click on the link, and it takes the user to the search page, using the post name as the search terms. So for example, if there post name is "iPhone X", the URL would take the user to the search page for "iPhone X" and show all results. </p>
  
  <p>I'm close, but the problem is...as written, the URL that is generated is 
  .../?s=iPhone-x (notice the hyphen)</p>
  
  <p>Search results are written with a "+" for each space
  .../?s=iPhone+X</p>
  
  <p>Is there a way I can either restructure the URL in the code, or somehow tell the system to replace all "-" with "+" before generating the URL?</p>
  
  <pre><code>    function user_posts_exercise( ) {
      if (!is_user_logged_in()) return;
      $items='';   
      $args = array(
          'post_type'      =&gt; 'post',
          'author'         =&gt; get_current_user_id(),
          'status'         =&gt; 'publish',
          'posts_per_page' =&gt; 10,
          'category_name'       =&gt; 'Exercise'
          );
      $jobs = get_posts( $args );
      foreach($jobs as $job){
        $link = '&lt;a href="'.home_url('/?s='.$job-&gt;post_name).'"&gt;'.$job-&gt;post_title.'&lt;/a&gt; 
      &lt;/BR&gt;'; 
        $items = $items . $link;
        }
      return $items;
      }
      add_shortcode( 'exercise_user_posts', 'user_posts_exercise' ); 
  </code></pre>