Skip to content

Instantly share code, notes, and snippets.

@Dianakc
Last active December 17, 2015 07:59
Show Gist options
  • Save Dianakc/90a4cb932502832c2ff0 to your computer and use it in GitHub Desktop.
Save Dianakc/90a4cb932502832c2ff0 to your computer and use it in GitHub Desktop.
Obtém ID da página por slyg
<?php
function get_ID_by_slug($page_slug) {
$page = get_page_by_path($page_slug);
if ($page) {
return $page->ID;
} else {
return null;
}
}
;?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment