Last active
December 17, 2015 07:59
-
-
Save Dianakc/90a4cb932502832c2ff0 to your computer and use it in GitHub Desktop.
Obtém ID da página por slyg
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 | |
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