wpseek.com
A WordPress-centric search engine for devs and theme authors
page_template_dropdown › WordPress Function
Since1.5.0
Deprecatedn/a
› page_template_dropdown ( $default_template = '', $post_type = 'page' )
Parameters: (2) |
|
Defined at: |
|
Codex: | |
Change Log: |
|
Prints out option HTML elements for the page templates drop-down.
Related Functions: parent_dropdown, get_template_directory, is_page_template, get_template_part, get_page_template
Source
function page_template_dropdown( $default_template = '', $post_type = 'page' ) { $templates = get_page_templates( null, $post_type ); ksort( $templates ); foreach ( array_keys( $templates ) as $template ) { $selected = selected( $default_template, $templates[ $template ], false ); echo "\n\t<option value='" . esc_attr( $templates[ $template ] ) . "' $selected>" . esc_html( $template ) . '</option>'; } }