parent_dropdown [ WordPress Function ]
parent_dropdown ( $default = 0, $parent = 0, $level = 0 )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Soorgelijke functies: page_template_dropdown, wp_dropdown_cats, walk_page_dropdown_tree, wp_dropdown_pages, wp_dropdown_users
{@internal Missing Short Description}}
Source
<?php
function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
global $wpdb, $post_ID;
$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 ) {
foreach ( $items as $item ) {
// A page cannot be its own parent.
if (!empty ( $post_ID ) ) {
if ( $item->ID == $post_ID ) {
continue;
}
}
$pad = str_repeat( ' ', $level * 3 );
if ( $item->ID == $default)
$current = ' selected="selected"';
else
$current = '';
echo "\n\t<option class='level-$level' value='$item->ID'$current>$pad " . esc_html($item->post_title) . "</option>";
parent_dropdown( $default, $item->ID, $level +1 );
}
} else {
return false;
}
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- WordPress › Support » Tags — parent_dropdown
Forums. Username or Email Address Password (forgot?) Register · WordPress › Support » parent_dropdown. Tag: parent_dropdown Add New » ...
wordpress.org - #17026 (parent_dropdown() is not filterable) – WordPress Trac
The parent_dropdown() function is no longer used by the WP core, but is not deprecated and remains in use by some plugins. Since other plugins may modify ...
core.trac.wordpress.org - parent_dropdown() WordPress function reference, arguments and ...
parent_dropdown( $default = 0, $parent = 0, $level = 0 ). default: (unknown_type) Default: 0; parent: (unknown_type) Default: 0; level: (unknown_type) Default: 0 ...
queryposts.com - Taxonomy - populate child dropdown based on parent dropdown ...
Issue Summary. I am wondering if there is a way to populate a taxonomy dropdown menu with the child terms of a selection made in another ...
drupal.org
Gebruikersdiscussies [ wordpress.org ]
- electrolund on "[Plugin: NextGEN Gallery] Album thumbnail link to post, not page"
- Speggey on "[Plugin: NextGEN Gallery] Album thumbnail link to post, not page"
- electrolund on "[Plugin: NextGEN Gallery] Album thumbnail link to post, not page"
- Speggey on "[Plugin: NextGEN Gallery] Album thumbnail link to post, not page"
- electrolund on "[Plugin: NextGEN Gallery] Album thumbnail link to post, not page"
- jtovar on "[Plugin: NextGEN Gallery] Album thumbnail link to post, not page"
- inTOWN on "[Plugin: NextGEN Gallery] Album thumbnail link to post, not page"
- horria on "[Plugin: NextGEN Gallery] Album thumbnail link to post, not page"
- carlbenton on "[Plugin: NextGEN Gallery] Album thumbnail link to post, not page"
- carlbenton on "[Plugin: NextGEN Gallery] Album thumbnail link to post, not page"