I am using this plugin: http://wordpress.org/extend/plugins/worldcurrency/
Shortcode syntax:
[worldcurrency cur="EUR" value="25"]
However, I’m using Advanced custom fields and the shortcode for custom fields is not being executed within the shortcode for worldcurrency.
[worldcurrency curr="[acf field="fl_currency"]" value="25"]
Any remedies here?
Update
I think I need to be using the
add_filter('xx','do_shortcode');
somehow?
I haven’t tried this, but you could try pseudo-changing the priority of your shortcode hook.
Basically, you force your shortcode to execute before it would normally. That link shows how to execute your shortcode separately – and, more importantly, before – the other shortcodes get implemented.
This works by caching and temporarily removing all existing shortcodes, executing yours, then reestablishing the other shortcodes.
If you look at the ACF shortcode in source (
api.php
), it just uses the API functionget_field
on the shortcode’sfield
attribute.If you look at the world currency shortcode in source (
worldcurrency.php
), it outputs a span with theworldcurrency
class and a couple of custom attributes, which then get converted on the user side via javascript.You could probably write your own shortcode that combines the two, using the output of world currency with ACF’s
get_field
to fetch the attributes from fields you specify.My answer involves changing the coding of world currency plugin.
Then write the shortcode like this:
In the code for the currency plugin, the value of the custom field will be available through the
$content
field.Then just set the curr field to
$content
and you should be good to go.