wp_dropdown_pages


wp_dropdown_pages ( $args = '' )

Parameters:
  • (array|string) args { Optional. Array or string of arguments to generate a page dropdown. See `get_pages()` for additional arguments. @type int $depth Maximum depth. Default 0. @type int $child_of Page ID to retrieve child pages of. Default 0. @type int|string $selected Value of the option that should be selected. Default 0. @type bool|int $echo Whether to echo or return the generated markup. Accepts 0, 1, or their bool equivalents. Default 1. @type string $name Value for the 'name' attribute of the select element. Default 'page_id'. @type string $id Value for the 'id' attribute of the select element. @type string $class Value for the 'class' attribute of the select element. Default: none. Defaults to the value of `$name`. @type string $show_option_none Text to display for showing no pages. Default empty (does not display). @type string $show_option_no_change Text to display for "no change" option. Default empty (does not display). @type string $option_none_value Value to use when no page is selected. Default empty. @type string $value_field Post field used to populate the 'value' attribute of the option elements. Accepts any valid post field. Default 'ID'. }
See:
Returns:
  • (string) HTML dropdown list of pages.
Defined at:
Change Log:
  • 4: .
  • 4: .

Description

Retrieve or display a list of pages as a dropdown (select list).

Related Functions

wp_dropdown_cats, wp_dropdown_languages, wp_dropdown_categories, wp_dropdown_roles, wp_dropdown_users

Top Google Results

User discussions

wpseek mobile