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 am building a learning management system using Wordpress, custom fields, and various plugins, especially SIMPLE FIELDS by Par Thernstrom. My shortcode plugins, such as Shortcode Exec PHP and Custom Field Value, work fine in the main editing box, but if I put any of my course information shortcodes into a custom field, they don't work in the custom field. I know that prevents "circular reference" problems, but it also prevents me form building a more streamlined system. Do you know of any workarounds that would allow plugins to operate on the contents of custom fields, so that custom fields could contain shortcodes? The specific configuration that I most need is for shortcodes from Shortcode Exec PHP to work on the wysiwyg textarea input boxes of SIMPLE FIELDS.

The problem is that right now, the custom field text managed by the SIMPLE FIELDS plugin is not evaluated by Wordpress for the presence of shortcodes of any sort, or for the presence of PHP code, as far as I can see from my experiments. Just as you might want to put shortcodes for teacher-name or text-book1 in the main edit box, one might also want to insert such local or global data strings into one or more custom fields.

There are a variety of text replacement plugins available, and so far as I can see they all work fine in the main edit window or a page or post, and none of them work if inserted into the text of a custom field.

share|improve this question

1 Answer 1

Pass the content in do_shortcode() will process all the shortcodes in it. So either make the change in your theme or plugin according to your setup.

// Lets say $data contains custom field data including shortcodes
$processed_data = do_shortcode( $data ); // will contain processed shortcodes
share|improve this answer

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.