mirror of
git://develop.git.wordpress.org/
synced 2025-03-15 01:19:51 +01:00
get_page_by_title()
git-svn-id: https://develop.svn.wordpress.org/trunk@4425 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
661e5dedc3
commit
1d570ec675
@ -946,6 +946,16 @@ function get_page_by_path($page_path, $output = OBJECT) {
|
|||||||
return NULL;
|
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) {
|
function &get_page_children($page_id, $pages) {
|
||||||
global $page_cache;
|
global $page_cache;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user