Created
February 23, 2016 19:27
-
-
Save alandbh/f9fb2b6b137990b7578d to your computer and use it in GitHub Desktop.
Retorna o slug de cada pagina
Returns the page slug
This file contains hidden or 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
// para retornar o slug de cada pagina | |
function the_slug($echo=true){ | |
$slug = basename(get_permalink()); | |
do_action('before_slug', $slug); | |
$slug = apply_filters('slug_filter', $slug); | |
if( $echo ) echo $slug; | |
do_action('after_slug', $slug); | |
return $slug; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment