Last active
August 29, 2015 14:17
-
-
Save AlexMcowkin/b9b79ab7abcb4aa33518 to your computer and use it in GitHub Desktop.
WP shortcodes: with params
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 user="Alex" login="Phpist85"] | |
// в файле functions.php | |
function fncName($atrs) | |
{ | |
$user = isset($atrs['user']) ? $atrs['user'] : 'EmptyUser' | |
$login = isset($atrs['login']) ? $atrs['login'] : 'EmptyLogin' | |
//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