I am using a feed importer plugin which gives the option to use a short code in case I need to change data (in this case data for a custom field) on import, using for example:


But how do I use this when I have more to change? Because it's a shortcode I can't use an array like:

    $a = 'this', 'another this';
    $b = 'that', 'another that';
    echo str_replace($a, $b, get_post_meta($post->ID, 'feedfield', true));

Can anyone enlighten my lack of knowledge?

  • 1
    without knowing what plugin this is, how can we help you? sounds like modifying it to accept an array somehow (list of comma separated terms?) that you might find enlightenment.
    – GhostToast
    Jul 2 '13 at 16:25
  • The plugin is not important I think? Question is how to use an array or multiple entries in a shortcode function (within brackets) But happy to answer your question: the plugin is WP-all-Import. I think you're saying it's not possible?
    – inTOWN
    Jul 2 '13 at 16:38
  • 1
    Well, the plugin either lets you pass an array or not. If not, you could modify that behavior possibly.
    – GhostToast
    Jul 2 '13 at 16:41
  • Okay, thanks a lot GhostToast , I'll look into the plugin
    – inTOWN
    Jul 2 '13 at 16:45
  • That is a strange looking shortcode and that functionality looks to be part of the $99 dollar "Pro" version. See: wordpress.org/plugins/wp-all-import
    – s_ha_dum
    Jul 2 '13 at 16:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.