Make WordPress Core

Ticket #10652: 10652.diff

File 10652.diff, 1006 bytes (added by wojtek.szkutnik, 16 years ago)
  • wp-admin/includes/template.php

     
    612612 *
    613613 * @param unknown_type $default
    614614 */
    615 function page_template_dropdown( $default = '' ) {
     615function page_template_dropdown( $args = '' ) {
     616        $defaults = array(
     617                'default' => '', 'echo' => 1
     618        );
     619        $r = wp_parse_args( $args, $defaults );
     620        extract( $r, EXTR_SKIP )
     621        $output = '';
     622       
    616623        $templates = get_page_templates();
    617624        ksort( $templates );
    618625        foreach (array_keys( $templates ) as $template )
     
    620627                        $selected = " selected='selected'";
    621628                else
    622629                        $selected = '';
    623         echo "\n\t<option value='".$templates[$template]."' $selected>$template</option>";
     630        $output .= "\n\t<option value='".$templates[$template]."' $selected>$template</option>";
    624631        endforeach;
     632       
     633        if ( $echo )
     634                echo $output;
     635
     636        return $output;
    625637}
    626638
    627639/**