Extract shortcode out of the_content()
-
Hi,
I’m struggling with this:
I would like to extract shortcode inserted in post with all atts and all into the do_shortcode() function.
For example, I have shortcode entered in post:
[icon icon_image="my_icon.png" size="large" style="dark"]
, and I would really need it something like this:<?php $my_extracted_shortcode = function_with_shortcode_extraction(); do_shortcode($my_extracted_shortcode); ?>
So, problem is with obviously – function_with_shortcode_extraction() :). I tried something with get_shortcode_regex(), but it only returns all the shortcodes available …
Anyone ?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Extract shortcode out of the_content()’ is closed to new replies.