Skip to content

Instantly share code, notes, and snippets.

@alandbh
Created February 23, 2016 19:27
Show Gist options
  • Save alandbh/f9fb2b6b137990b7578d to your computer and use it in GitHub Desktop.
Save alandbh/f9fb2b6b137990b7578d to your computer and use it in GitHub Desktop.
Retorna o slug de cada pagina Returns the page slug
// 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