Changeset 5486 for branches/2.2/wp-includes/widgets.php
- Timestamp:
- 05/18/2007 02:29:11 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/wp-includes/widgets.php
r5484 r5486 327 327 /* Default Widgets */ 328 328 329 function wp_widget_pages($args) { 330 extract($args); 331 $options = get_option('widget_pages'); 332 $title = empty($options['title']) ? __('Pages') : $options['title']; 333 echo $before_widget . $before_title . $title . $after_title . "<ul>\n"; 334 wp_list_pages("title_li="); 335 echo "</ul>\n" . $after_widget; 329 function wp_widget_pages( $args ) { 330 extract( $args ); 331 $options = get_option( 'widget_pages' ); 332 333 $title = empty( $options['title'] ) ? __( 'Pages' ) : $options['title']; 334 $sortby = empty( $options['sortby'] ) ? 'menu_order' : $options['sortby']; 335 336 if ( $sortby == 'menu_order' ) { 337 $sortby = 'menu_order, post_title'; 338 } 339 340 $out = wp_list_pages( 'title_li=&echo=0&sort_column=' . $sortby ); 341 342 if ( !empty( $out ) ) { 343 ?> 344 <?php echo $before_widget; ?> 345 <?php echo $before_title . $title . $after_title; ?> 346 <ul> 347 <?php echo $out; ?> 348 </ul> 349 <?php echo $after_widget; ?> 350 <?php 351 } 336 352 } 337 353 338 354 function wp_widget_pages_control() { 339 355 $options = $newoptions = get_option('widget_pages'); 340 if ( $_POST["pages-submit"] ) { 341 $newoptions['title'] = strip_tags(stripslashes($_POST["pages-title"])); 356 if ( $_POST['pages-submit'] ) { 357 $newoptions['title'] = strip_tags(stripslashes($_POST['pages-title'])); 358 359 $sortby = stripslashes( $_POST['pages-sortby'] ); 360 361 if ( in_array( $sortby, array( 'post_title', 'menu_order', 'ID' ) ) ) { 362 $newoptions['sortby'] = $sortby; 363 } else { 364 $newoptions['sortby'] = 'menu_order'; 365 } 342 366 } 343 367 if ( $options != $newoptions ) { … … 348 372 ?> 349 373 <p><label for="pages-title"><?php _e('Title:'); ?> <input style="width: 250px;" id="pages-title" name="pages-title" type="text" value="<?php echo $title; ?>" /></label></p> 374 <p><label for="pages-sortby"><?php _e( 'Sort by:' ); ?> 375 <select name="pages-sortby" id="pages-sortby"> 376 <option value="post_title"><?php _e('Page title'); ?></option> 377 <option value="menu_order"><?php _e('Menu order'); ?></option> 378 <option value="ID"><?php _e( 'Page ID' ); ?></option> 379 </select></label></p> 350 380 <input type="hidden" id="pages-submit" name="pages-submit" value="1" /> 351 381 <?php … … 496 526 if ( empty($title) ) 497 527 $title = ' '; 498 $text = $options[$number]['text'];528 $text = apply_filters( 'the_content', $options[$number]['text'] ); 499 529 ?> 500 530 <?php echo $before_widget; ?> 501 <?php $title? print($before_title . $title . $after_title) : null; ?>531 <?php !empty( $title ) ? print($before_title . $title . $after_title) : null; ?> 502 532 <div class="textwidget"><?php echo $text; ?></div> 503 533 <?php echo $after_widget; ?> … … 522 552 $text = attribute_escape($options[$number]['text']); 523 553 ?> 524 <input style="width: 450px;" id="text-title-<?php echo "$number"; ?>" name="text-title-<?php echo "$number"; ?>" type="text" value="<?php echo $title; ?>" />525 <textarea style="width: 450px; height: 280px;" id="text-text-<?php echo "$number"; ?>" name="text-text-<?php echo "$number"; ?>"><?php echo $text; ?></textarea>554 <input style="width: 450px;" id="text-title-<?php echo $number; ?>" name="text-title-<?php echo $number; ?>" type="text" value="<?php echo $title; ?>" /> 555 <textarea style="width: 450px; height: 280px;" id="text-text-<?php echo $number; ?>" name="text-text-<?php echo $number; ?>"><?php echo $text; ?></textarea> 526 556 <input type="hidden" id="text-submit-<?php echo "$number"; ?>" name="text-submit-<?php echo "$number"; ?>" value="1" /> 527 557 <?php
Note: See TracChangeset
for help on using the changeset viewer.