title: wp all import custom function to replace an attribute within in image URL
body: <p>I’m using WP All Import to import products. I’ve run into a bit of an issue with trying to map product variation images.</p>
  
  <p>My XML file contains an <code>&lt;ItemNo&gt;</code></p>
  
  <p>Each variation has the same product name and variations are handled by different item numbers in this manner</p>
  
  <pre><code>&lt;ItemNo&gt;450042-02&lt;/ItemNo&gt;
  &lt;ItemNo&gt;450042-05&lt;/ItemNo&gt;
  &lt;ItemNo&gt;450042-07&lt;/ItemNo&gt;
  </code></pre>
  
  <p>These are the image url is</p>
  
  <pre><code>/ImageServices/image.ashx?itemid=450042&amp;config=02&amp;format=l&amp;imagenumber=1
  </code></pre>
  
  <p>if you break this down</p>
  
  <ul>
  <li><code>450042&amp;config=02</code> would match to 450042-02</li>
  <li><code>450042&amp;config=05</code> would match to 450042-05</li>
  </ul>
  
  <p>and so on</p>
  
  <ul>
  <li><code>&amp;format=l</code>, <code>&amp;format=s</code> (this represents large or small image
  and i think image number is irrelevant at this point)</li>
  </ul>
  
  <p>if I put below in the image url</p>
  
  <pre><code>/ImageServices/image.ashx?itemid={ItemNo[1]}&amp;format=l&amp;imagenumber=1
  </code></pre>
  
  <p>it would output the following which won’t work</p>
  
  <blockquote>
    <p><a href="https://domain.com/ImageServices/image.ashx?itemid=450042-02&amp;format=l&amp;imagenumber=1" rel="nofollow">https://domain.com/ImageServices/image.ashx?itemid=450042-02&amp;format=l&amp;imagenumber=1</a></p>
  </blockquote>
  
  <p>so i’d need to change the hyphen to <code>&amp;config=</code></p>
  
  <p>wp all import accepts custom functions, anyone know a function to replace the <code>-</code> to <code>&amp;config=</code> in the <code>{ItemNo[1]}</code> in only the image section?</p>