mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
get_page_by_title()
git-svn-id: http://svn.automattic.com/wordpress/trunk@4425 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c476029674
commit
209ca583ff
@ -946,6 +946,16 @@ function get_page_by_path($page_path, $output = OBJECT) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
function get_page_by_title($page_title, $output = OBJECT) {
|
||||
global $wpdb;
|
||||
$page_title = $wpdb->escape($page_title);
|
||||
$page = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_title = '$page_title' AND post_type='page'");
|
||||
if ( $page )
|
||||
return get_page($page, $output);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
function &get_page_children($page_id, $pages) {
|
||||
global $page_cache;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user