title: Non repeating content change for wordpress using add_filter
body: <p>I want to put a pdf icon in for pdf links automatically in wordpress </p>
  
  <pre><code>function my_function($content) {
      $search = '^.pdf"&gt;^';
      $replace='.pdf"&gt;&lt;img src="domain.com/pdf-icon.jpg" width="64" height="64" alt="pdf download"/&gt;';
      return preg_replace($search,$replace,$content);
  }
  add_filter('content_save_pre','my_function');
  </code></pre>
  
  <p>Works, but if the post is edited again another image gets added.
  How do I change it to not replace where the search for <code>.pdf</code> has the img tag already straight after it?</p>