Created
March 10, 2012 17:23
-
-
Save kachi/2012198 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 | |
function escape_my_code( $attr, $content = null ) { | |
$content = clean_pre($content); | |
return '<pre"><code>' . | |
str_replace('<', '<', $content) . | |
'</code></pre>'; | |
} | |
add_shortcode('code', 'escape_my_code'); | |
?> | |
/*記事内で[code]<?php echo 'Hello World!' ?>[/code]と書く*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment