wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
page_template_dropdown › WordPress Function
Seit1.5.0
Veraltetn/v
› page_template_dropdown ( $default_template = '', $post_type = 'page' )
Parameter: (2) |
|
Definiert in: |
|
Codex: | |
Changelog: |
|
Prints out option HTML elements for the page templates drop-down.
Ähnliche Funktionen: parent_dropdown, get_template_directory, is_page_template, get_template_part, get_page_template
Quellcode
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>'; } }