Last active
August 29, 2015 14:17
-
-
Save AlexMcowkin/f880863cc27253172fcd to your computer and use it in GitHub Desktop.
WP shortcodes: with content
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 | |
// в посте добавить | |
[shortcodeName]Some content here[/shortcodeName] | |
// в файле functions.php | |
function fncName($atrs, $content) | |
{ | |
$content = !empty($content) ? $content : 'No content' | |
//body | |
return $output; | |
} | |
add_shortcode('shortcodeName', 'fncName'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment