Processing Shortcode
-
So home come your plugin doesn’t process shortcode? I did a bunch of searching around and was amazed that you don’t do it. I tried to build a class extension to do it but couldn’t figure out a way to hook into your plugin or extend the class in between the initialization and the processing of the content.
A simple modification to the “get_field” function of the blcContainer container class adds shortcode processing:
$value = $w->$field;
if (!empty($value) && $field == ‘post_content’) $value = do_shortcode($value);
return $value;function get_field($field = ''){ if ( empty($field) ){ $field = $this->default_field; } $w = $this->get_wrapped_object(); $value = $w->$field; if (!empty($value) && $field == 'post_content') $value = do_shortcode($value); return $value; }
I found 3 broken links that the plugin didn’t pick up because they were generated by shortcode (something from a global content block in this case). If there is a good reason not to process shortcode, could you make it an option to do so and/or provide a place to hook into or extend a class?
- The topic ‘Processing Shortcode’ is closed to new replies.