wp_dropdown_pages( array|string $args = '' )

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


25 related functions found for: wp_dropdown_pages

Top ↑

Related terms found for this post

TaxonomyTerms
wp-parser-related-wordsdropdown, page, pages, post-template-php, wp-dropdown, wp-includes
wp-parser-packageTemplate, WordPress
wp-parser-source-filewp-includes/post-template.php

Top ↑

Terms Used Terms Used

Terms used in the related posts query

  • dropdown
  • page
  • pages
  • post-template-php
  • Template
  • wp-dropdown
  • wp-includes
  • wp-includes/post-template.php
  • template

Top ↑

Description Description


Top ↑

Parameters Parameters

$args

(array|string) (Optional) Array or string of arguments to generate a pages drop-down element.

  • 'depth'
    (int) Maximum depth. Default 0.
  • 'child_of'
    (int) Page ID to retrieve child pages of. Default 0.
  • 'selected'
    (int|string) Value of the option that should be selected. Default 0.
  • 'echo'
    (bool|int) Whether to echo or return the generated markup. Accepts 0, 1, or their bool equivalents. Default 1.
  • 'name'
    (string) Value for the 'name' attribute of the select element. Default 'page_id'.
  • 'id'
    (string) Value for the 'id' attribute of the select element.
  • 'class'
    (string) Value for the 'class' attribute of the select element. Default: none. Defaults to the value of $name.
  • 'show_option_none'
    (string) Text to display for showing no pages. Default empty (does not display).
  • 'show_option_no_change'
    (string) Text to display for "no change" option. Default empty (does not display).
  • 'option_none_value'
    (string) Value to use when no page is selected.
  • 'value_field'
    (string) Post field used to populate the 'value' attribute of the option elements. Accepts any valid post field. Default 'ID'.

Default value: ''


Top ↑

Return Return

(string) HTML content, if not displaying.


Top ↑

Source Source

File: wp-includes/post-template.php


			

Top ↑

Changelog Changelog

Changelog
Version Description
4.3.0 The $class argument was added.
4.2.0 The $value_field argument was added.
2.1.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.