0

I'm writing a plugin for a wordpress site using a page template using WP Types plugin.

My plugin adds a shortcode tag.

Shortcode tags inside 'the_content' get processed without problem.

But this page template echoes types_render_field(...) WP Types function which gets and returns content containing shortcode tags retrieved from the database using get_post_custom($postid) wordpress core function call.

I want to process these shortcode tags without modifying the template or WP Types plugin, just using my plugin code.

Is that possible?

4
  • If this is the plugin, it is commercial. The code is not easy to come by. Ask their support about this. Commented Dec 29, 2013 at 15:45
  • I don't know if it's commercial or not (it's not my deployment), but the code is available for download in wordpress.org: downloads.wordpress.org/plugin/types.1.5.3.zip Commented Dec 29, 2013 at 18:28
  • What is the code for types_render_field? Commented Dec 29, 2013 at 18:42
  • it's on file types/embedded/frontend.php Commented Dec 29, 2013 at 19:40

1 Answer 1

1

I will never understand the point of these wildly complicated "helper" wrapper/plugins... but that aside...

The plugin provides a lot of filters that might help you out. I think that the types_view filter might be what you want. Something like this is a plugin file or your theme functions.php might do it:

add_filter('types_view','do_shortcode');

I do not use that plugin, have never used that plugin, and I am guessing-- a lot-- but I hope that helps.

1
  • I still had to unescape and reformat the arguments passed to the shortcode handler function, (I got something like array([0]=>'\\'fieldname\\'='\\'Title\\', ...) instead of array('fieldname'=>'Title', ...))) but it worked. Thank you so much: WP Types is massive and way too complex (I also don't understand where's the benefit: you can probably achieve more or less the same functionality on this site without using it) and this problem was driving me crazy ^^' Commented Dec 30, 2013 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.