Skip to content

Instantly share code, notes, and snippets.

@AlexMcowkin
Last active August 29, 2015 14:17
Show Gist options
  • Save AlexMcowkin/f880863cc27253172fcd to your computer and use it in GitHub Desktop.
Save AlexMcowkin/f880863cc27253172fcd to your computer and use it in GitHub Desktop.
WP shortcodes: with content
<?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