mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-09 09:57:38 +01:00
Add an argument to parent_dropdown()
, $post
, to allow it to be called for an arbitrary post.
Fixes #23162. Built from https://develop.svn.wordpress.org/trunk@34111 git-svn-id: http://core.svn.wordpress.org/trunk@34079 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
172e37b007
commit
ecc4106ed1
@ -860,18 +860,20 @@ function page_template_dropdown( $default = '' ) {
|
||||
* Print out option HTML elements for the page parents drop-down.
|
||||
*
|
||||
* @since 1.5.0
|
||||
* @since 4.4.0 `$post` argument was added.
|
||||
*
|
||||
* @global wpdb $wpdb
|
||||
*
|
||||
* @param int $default Optional. The default page ID to be pre-selected. Default 0.
|
||||
* @param int $parent Optional. The parent page ID. Default 0.
|
||||
* @param int $level Optional. Page depth level. Default 0.
|
||||
* @param int|WP_Post $post Post ID or WP_Post object.
|
||||
*
|
||||
* @return null|false Boolean False if page has no children, otherwise print out html elements
|
||||
*/
|
||||
function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
|
||||
function parent_dropdown( $default = 0, $parent = 0, $level = 0, $post = null ) {
|
||||
global $wpdb;
|
||||
$post = get_post();
|
||||
$post = get_post( $post );
|
||||
$items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) );
|
||||
|
||||
if ( $items ) {
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.4-alpha-34110';
|
||||
$wp_version = '4.4-alpha-34111';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user