Last active
December 15, 2015 20:09
-
-
Save Dianakc/a68cc1550ec74446e91d to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
// Shortcode implementation | |
function magic_stuff($atts) { | |
// turn on output buffering to capture script output | |
ob_start(); | |
// include file (contents will get saved in output buffer) | |
include(TEMPLATEPATH.'/wp-content/prugins/magic-plugin/magic-code.php'); | |
// save and return the content that has been output | |
$content = ob_get_clean(); | |
return $content; | |
} | |
//register the Shortcode handler | |
add_shortcode('magic', 'magic_stuff'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment