Make WordPress Core

Changeset 3852


Ignore:
Timestamp:
06/07/2006 11:27:25 PM (20 years ago)
Author:
ryan
Message:

Add show_option_none to wp_dropdown_pages(). Props ryanscheuermann. #2515

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-reading.php

    r3759 r3852  
    3030        </label>
    3131<ul>
    32         <li><?php printf(__('Show this page on the front page: %s'), wp_dropdown_pages("name=page_on_front&echo=0&selected=" . get_option('page_on_front'))); ?></li>
    33         <li><?php printf(__('Show the latest posts on this page: %s'), wp_dropdown_pages("name=page_for_posts&echo=0&selected=" . get_option('page_for_posts'))); ?></li>
     32        <li><?php printf(__('Show this page on the front page: %s'), wp_dropdown_pages("name=page_on_front&echo=0&show_option_none=".__('- Select -')."&selected=" . get_option('page_on_front'))); ?></li>
     33        <li><?php printf(__('Show the latest posts on this page: %s'), wp_dropdown_pages("name=page_for_posts&echo=0&show_option_none=".__('- Select -')."&selected=" . get_option('page_for_posts'))); ?></li>
    3434</ul>
    3535<?php if ( 'page' == get_option('show_on_front') && get_option('page_for_posts') == get_option('page_on_front') ) : ?>
  • trunk/wp-includes/post-template.php

    r3851 r3852  
    229229
    230230        $defaults = array('depth' => 0, 'child_of' => 0, 'selected' => 0, 'echo' => 1,
    231                 'name' => 'page_id');
     231                'name' => 'page_id', 'show_option_none' => '');
    232232        $r = array_merge($defaults, $r);
    233233        extract($r);
    … …  
    238238        if ( ! empty($pages) ) {
    239239                $output = "<select name='$name'>\n";
     240                if ( $show_option_none )
     241                        $output .= "\t<option value=''>$show_option_none</option>\n";
    240242                $output .= walk_page_dropdown_tree($pages, $depth, $r);
    241243                $output .= "</select>\n";
Note: See TracChangeset for help on using the changeset viewer.