Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
    
If this is the plugin, it is commercial. The code is not easy to come by. Ask their support about this. –  s_ha_dum Dec 29 '13 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 –  elcodedocle Dec 29 '13 at 18:28
    
What is the code for types_render_field? –  s_ha_dum Dec 29 '13 at 18:42
    
it's on file types/embedded/frontend.php –  elcodedocle Dec 29 '13 at 19:40
add comment

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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 ^^' –  elcodedocle Dec 30 '13 at 8:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.