php - How would you combine this wordpress shortcode template code? -


I am using a plugin that is generating my price value and pulling it from the array:

  & lt ;? Php echo __ ('value:', 'event_presspress'); ? & Gt; & Lt; / Span & gt; & Lt ;? Php echo $ org_options ['currency_symbol']. $ Event- & gt; Event_cost; ? & Gt;   

I want to convert this generated value into the currency of my visitors, depending on the country, with the plugin 'WorldCurugesesi'.

However, you must input the value of such small code:

  in the United States [worldcurrency curr = "EUR" value = "25"] will show: (~ 30 $ USD)   

Now I know how to use a shortcode code in a template php file, but I do not know whether this array includes my array value and currency symbol It is possible to do Instead of using value = "25" , I need to use it:

value = "& lt ;? php echo $ org_options ['currency_symbol' ]. $ Event-> Event_cost ;? & gt; "

Is this possible?

I'm not sure whether it is possible to use PHP code inline in a shortcode - and I No doubt, though, an easy way to implement it will be to write a short code of your own, which is called another shortcode.

Your shortcode will generate text that you want (for example, '[worldcurrency curr = "EUR" value = "25"]'), and call "do_shortcode ($ content)", from which The reason for the other plugin would be to search for currency for you.

You can put it in a plugin file and possibly it will be less than 15 lines.

The second option is to modify the Currency Conversion Plugin that you are using to use the output you want.

Comments