Created
July 12, 2015 19:09
-
-
Save badah/e472f34b5cafedac79ef to your computer and use it in GitHub Desktop.
Wordpress: render shortcode in proper place
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Use the following snipet to render shortcode proper in a Wordpress theme | |
| function myfunction_func() { | |
| // code goes here | |
| } | |
| function myfunction_func_buffer() { | |
| ob_start(); | |
| myfunction_func(); | |
| $myfunction_func = ob_get_clean(); | |
| return $myfunction_func; | |
| } | |
| add_shortcode('valor-pagamento', 'myfunction_func'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment