Changeset 14404
- Timestamp:
- 05/03/2010 08:26:11 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-ajax.php
r14295 r14404 135 135 if ( ! current_user_can( 'switch_themes' ) ) 136 136 die('-1'); 137 137 138 138 require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; 139 139 … … 400 400 $menu_item_id = (int) $_POST['menu-item']; 401 401 check_admin_referer( 'delete-menu_item_' . $menu_item_id ); 402 if ( ! current_user_can( 'switch_themes' ) ) 402 if ( ! current_user_can( 'switch_themes' ) ) 403 403 die('-1'); 404 404 … … 828 828 if ( isset( $_POST['menu-item'] ) ) { 829 829 $item_ids = wp_save_nav_menu_item( $menu_id, $_POST['menu-item'] ); 830 if ( is_wp_error( $item_ids ) ) 830 if ( is_wp_error( $item_ids ) ) 831 831 die('-1'); 832 832 } else { 833 833 $item_ids = array(); 834 834 } 835 835 836 836 foreach ( (array) $item_ids as $menu_item_id ) { 837 837 $menu_obj = get_post( $menu_item_id ); … … 848 848 'link_after' => '', 849 849 'link_before' => '', 850 'walker' => new Walker_Nav_Menu_Edit, 850 'walker' => new Walker_Nav_Menu_Edit, 851 851 ); 852 852 echo walk_nav_menu_tree( $menu_items, 0, (object) $args ); … … 1094 1094 if ( ! current_user_can( 'switch_themes' ) ) 1095 1095 die('-1'); 1096 1096 1097 1097 require_once ABSPATH . 'wp-admin/includes/nav-menu.php'; 1098 1098 -
trunk/wp-admin/css/ms.dev.css
r14024 r14404 10 10 } 11 11 12 #dashboard_right_now div.musubtable { 13 border-top: none; 12 #dashboard_right_now div.musubtable { 13 border-top: none; 14 14 } 15 15 -
trunk/wp-admin/css/nav-menu-rtl.dev.css
r14279 r14404 1 .howto span { 2 float: right; 1 .howto span { 2 float: right; 3 3 } 4 .menu-item-textbox { 5 float: left; 4 .menu-item-textbox { 5 float: left; 6 6 } 7 .add-to-menu { 8 float: left; 7 .add-to-menu { 8 float: left; 9 9 } 10 10 .menu-item-title input[type="checkbox"] { 11 margin-left: 3px; 11 margin-left: 3px; 12 12 } 13 13 .menu li dl dt { … … 17 17 .menu li ul li { 18 18 margin-left: 0; 19 margin-right: 20px; 19 margin-right: 20px; 20 20 } 21 .menu li .item-title { 21 .menu li .item-title { 22 22 margin-right: 0; 23 margin-left: 18em; 23 margin-left: 18em; 24 24 } 25 .item-controls { 25 .item-controls { 26 26 right: auto; 27 left: 15px; 27 left: 15px; 28 28 } 29 29 .item-type { 30 30 padding-right: 0; 31 padding-left: 10px; 31 padding-left: 10px; 32 32 } -
trunk/wp-admin/css/nav-menu.dev.css
r14373 r14404 56 56 margin-bottom: 20px; 57 57 } 58 58 59 59 #nav-menu-header, #post-body { 60 60 border-color: #ccc; 61 61 border-style: solid; 62 62 } 63 63 64 64 #nav-menu-header { 65 65 background: url("../images/gray-grad.png") repeat-x scroll left top #dfdfdf; … … 74 74 border-top-right-radius: 6px; 75 75 } 76 76 77 77 #post-body { 78 78 background: #fff; … … 88 88 border-bottom-right-radius: 6px; 89 89 } 90 90 91 91 #post-body-content { 92 92 position: relative; 93 93 } 94 94 95 95 .post-body-plain { 96 96 padding: 10px 10px 0 0; … … 100 100 font-weight:bold; 101 101 } 102 102 103 103 /* Menu Tabs */ 104 104 105 105 #menu-management .nav-tabs-nav { 106 106 margin: 0 20px; … … 163 163 padding: 0 10px 3px 10px; 164 164 margin-bottom: 5px; 165 } 165 } 166 166 #select-nav-menu { 167 167 width: 100px; 168 168 display: inline; 169 169 } 170 170 171 171 /* Menu Toolbar */ 172 172 #menu-management #major-publishing-actions #delete-action { … … 185 185 padding-right: 10px; 186 186 } 187 187 188 188 .js .input-with-default-title { 189 189 color: #aaa; … … 211 211 /* Button Secondary Actions */ 212 212 .list-controls { float: left; margin-top: 5px; } 213 .add-to-menu { 213 .add-to-menu { 214 214 float: right; 215 215 } … … 266 266 .menu ul.sub-menu { 267 267 } 268 .menu li { 268 .menu li { 269 269 margin-bottom: 0; 270 270 } … … 277 277 .menu li dl dt { 278 278 background: url("../images/gray-grad.png") repeat-x scroll left top #DFDFDF; 279 border: 1px solid #E6E6E6; 279 border: 1px solid #E6E6E6; 280 280 clear:both; 281 position: relative; 281 position: relative; 282 282 padding-left: 10px; 283 283 height: auto; 284 width: 400px; 284 width: 400px; 285 285 line-height: 35px; 286 286 text-shadow: 0 1px 0 #FFFFFF; … … 290 290 .menu li dl.menu-item-edit-inactive dt { 291 291 border-radius: 6px; 292 -webkit-border-radius: 6px; 292 -webkit-border-radius: 6px; 293 293 -moz-border-radius: 6px; 294 294 -khtml-border-radius: 6px; … … 312 312 } 313 313 314 .menu li .item-title { 314 .menu li .item-title { 315 315 padding: 7px 0; 316 316 line-height: 20px; … … 425 425 color: #777; 426 426 font-style: italic; 427 border: 1px solid #dfdfdf; 427 border: 1px solid #dfdfdf; 428 428 border-radius: 6px; 429 -webkit-border-radius: 6px; 429 -webkit-border-radius: 6px; 430 430 -moz-border-radius: 6px; 431 431 -khtml-border-radius: 6px; -
trunk/wp-admin/css/press-this.dev.css
r14149 r14404 317 317 margin: 1px; 318 318 } 319 319 320 320 .category-add select { 321 321 width: 100%; -
trunk/wp-admin/css/wp-admin.dev.css
r14390 r14404 2015 2015 2016 2016 div.tabs-panel-active { 2017 display:block; 2017 display:block; 2018 2018 } 2019 2019 2020 2020 div.tabs-panel-inactive { 2021 display:none; 2021 display:none; 2022 2022 } 2023 2023 -
trunk/wp-admin/custom-background.php
r14379 r14404 155 155 <th scope="row"><?php _e('Current Image'); ?></th> 156 156 <td> 157 <style type="text/css"> 157 <style type="text/css"> 158 158 #custom-background-image { 159 159 background-color: #<?php echo get_background_color()?>; … … 165 165 <?php } ?> 166 166 } 167 </style> 167 </style> 168 168 <div id="custom-background-image"> 169 169 <?php if ( get_background_image() ) { ?> -
trunk/wp-admin/includes/file.php
r14400 r14404 642 642 643 643 if ( '__MACOSX/' === substr($info['name'], 0, 9) ) // Don't extract the OS X-created __MACOSX directory files 644 continue; 644 continue; 645 645 646 646 $contents = $z->getFromIndex($i); … … 686 686 // Determine any children directories needed (From within the archive) 687 687 foreach ( $archive_files as $file ) { 688 if ( '__MACOSX/' === substr($file['filename'], 0, 9) ) // Skip the OS X-created __MACOSX directory 688 if ( '__MACOSX/' === substr($file['filename'], 0, 9) ) // Skip the OS X-created __MACOSX directory 689 689 continue; 690 690 691 691 $needed_dirs[] = $to . untrailingslashit( $file['folder'] ? $file['filename'] : dirname($file['filename']) ); 692 692 } -
trunk/wp-admin/includes/media.php
r14374 r14404 2161 2161 if ( !post_type_supports(get_post_type($_GET['post_id']), 'editor') ) 2162 2162 return ''; 2163 2163 2164 2164 if ( 'image' == $type ) 2165 2165 return ' … … 2169 2169 <input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . esc_attr__('Insert into Post') . '" /> 2170 2170 </td> 2171 </tr> 2171 </tr> 2172 2172 '; 2173 2173 -
trunk/wp-admin/includes/meta-boxes.php
r14390 r14404 249 249 $help_nojs = isset( $taxonomy->help_nojs ) ? $taxonomy->help_nojs : __('Add or remove tags'); 250 250 $help_cloud = isset( $taxonomy->help_cloud ) ? $taxonomy->help_cloud : __('Choose from the most used tags in %s'); 251 251 252 252 $disabled = !current_user_can($taxonomy->assign_cap) ? 'disabled="disabled"' : ''; 253 253 ?> -
trunk/wp-admin/includes/ms.php
r14374 r14404 453 453 $space .= __( 'GB' ); 454 454 } else { 455 /* translators: Megabytes */ 455 /* translators: Megabytes */ 456 456 $space .= __( 'MB' ); 457 457 } … … 547 547 function format_code_lang( $code = '' ) { 548 548 $code = strtolower( substr( $code, 0, 2 ) ); 549 $lang_codes = array( 549 $lang_codes = array( 550 550 'aa' => 'Afar', 'ab' => 'Abkhazian', 'af' => 'Afrikaans', 'ak' => 'Akan', 'sq' => 'Albanian', 'am' => 'Amharic', 'ar' => 'Arabic', 'an' => 'Aragonese', 'hy' => 'Armenian', 'as' => 'Assamese', 'av' => 'Avaric', 'ae' => 'Avestan', 'ay' => 'Aymara', 'az' => 'Azerbaijani', 'ba' => 'Bashkir', 'bm' => 'Bambara', 'eu' => 'Basque', 'be' => 'Belarusian', 'bn' => 'Bengali', 551 551 'bh' => 'Bihari', 'bi' => 'Bislama', 'bs' => 'Bosnian', 'br' => 'Breton', 'bg' => 'Bulgarian', 'my' => 'Burmese', 'ca' => 'Catalan; Valencian', 'ch' => 'Chamorro', 'ce' => 'Chechen', 'zh' => 'Chinese', 'cu' => 'Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic', 'cv' => 'Chuvash', 'kw' => 'Cornish', 'co' => 'Corsican', 'cr' => 'Cree', … … 631 631 if ( $code_lang == 'en_US' ) { // American English 632 632 $flag = true; 633 $ae = __( 'American English' ); 633 $ae = __( 'American English' ); 634 634 $output[$ae] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang ) . '> ' . $ae . '</option>'; 635 635 } elseif ( $code_lang == 'en_GB' ) { // British English -
trunk/wp-admin/includes/nav-menu.php
r14374 r14404 17 17 */ 18 18 function start_lvl(&$output, $depth) {} 19 19 20 20 /** 21 21 * @see Walker_Nav_Menu::end_lvl() … … 26 26 */ 27 27 function end_lvl(&$output, $depth) {} 28 28 29 29 /** 30 30 * @see Walker::start_el() … … 50 50 '_wpnonce', 51 51 ); 52 52 53 53 $original_title = ''; 54 54 if ( 'taxonomy' == $item->type ) { … … 60 60 ?> 61 61 <li id="menu-item-<?php echo $item_id; ?>" class="menu-item menu-item-depth-<?php echo $depth; ?> menu-item-<?php echo strtolower(esc_attr( $item->append )); ?>"> 62 <dl class="<?php 62 <dl class="<?php 63 63 if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] ) 64 64 echo 'menu-item-edit-active'; … … 72 72 <span class="item-order"> 73 73 <a href="<?php 74 echo wp_nonce_url( 74 echo wp_nonce_url( 75 75 add_query_arg( 76 76 array( 77 'action' => 'move-up-menu-item', 77 'action' => 'move-up-menu-item', 78 78 'menu-item' => $item_id, 79 79 ), 80 remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) 81 ), 82 'move-item' 83 ); 80 remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) 81 ), 82 'move-item' 83 ); 84 84 ?>" class="item-move-up"><abbr title="<?php esc_attr_e('Move up'); ?>">↑</abbr></a> 85 85 | 86 86 <a href="<?php 87 echo wp_nonce_url( 87 echo wp_nonce_url( 88 88 add_query_arg( 89 89 array( 90 'action' => 'move-down-menu-item', 90 'action' => 'move-down-menu-item', 91 91 'menu-item' => $item_id, 92 92 ), 93 remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) 94 ), 93 remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) 94 ), 95 95 'move-item' 96 ); 96 ); 97 97 ?>" class="item-move-down"><abbr title="<?php esc_attr_e('Move down'); ?>">↓</abbr></a> 98 98 </span> 99 <a class="item-edit" id="edit-<?php echo $item_id; ?>" title="<?php _e('Edit Menu Item'); ?>" href="<?php 100 echo add_query_arg('edit-menu-item', $item_id, remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) ); 99 <a class="item-edit" id="edit-<?php echo $item_id; ?>" title="<?php _e('Edit Menu Item'); ?>" href="<?php 100 echo add_query_arg('edit-menu-item', $item_id, remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) ); 101 101 ?>#menu-item-settings-<?php echo $item_id; ?>">Edit Menu Item</a> 102 102 </span> … … 104 104 </dl> 105 105 106 <div class="menu-item-settings <?php 106 <div class="menu-item-settings <?php 107 107 if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] ) 108 108 echo 'menu-item-edit-active'; 109 109 else 110 110 echo 'menu-item-edit-inactive'; 111 ?>" id="menu-item-settings-<?php echo $item_id; ?>"> 111 ?>" id="menu-item-settings-<?php echo $item_id; ?>"> 112 112 <?php if( 'custom' == $item->type ) : ?> 113 113 <p class="field-url description description-wide"> … … 158 158 </label> 159 159 </p> 160 160 161 161 <span class="menu-item-actions description-wide submitbox"> 162 162 <?php if( 'custom' != $item->type ) : ?> 163 163 <p class="link-to-original"><?php 164 _e('Original '); 164 _e('Original '); 165 165 echo esc_html( $item->append ); 166 166 echo ":"; ?> … … 170 170 </p> 171 171 <?php endif; ?> 172 <a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?>" href="<?php 172 <a class="item-delete submitdelete deletion" id="delete-<?php echo $item_id; ?>" href="<?php 173 173 echo wp_nonce_url( 174 174 add_query_arg( … … 177 177 'menu-item' => $item_id, 178 178 ), 179 remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) 179 remove_query_arg($removed_args, admin_url( 'nav-menus.php' ) ) 180 180 ), 181 181 'delete-menu_item_' . $item_id … … 183 183 <input class="button-primary save-menu-item" name="save_menu_item" type="submit" value="<?php esc_attr_e('Save Menu Item'); ?>" /> 184 184 </span> 185 185 186 186 <input class="menu-item-data-append" type="hidden" name="menu-item-append[<?php echo $item_id; ?>]" value="<?php echo $item->append; ?>" /> 187 187 <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" /> … … 191 191 <input class="menu-item-data-position" type="hidden" class="menu-item-position" name="menu-item-position[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->menu_order ); ?>" /> 192 192 <input class="menu-item-data-type" type="hidden" name="menu-item-type[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->type ); ?>" /> 193 </div><!-- .menu-item-settings--> 193 </div><!-- .menu-item-settings--> 194 194 <ul class="menu-item-transport"></ul> 195 195 <?php … … 202 202 * 203 203 * @since 3.0.0 204 * 204 * 205 205 * @param array $request The unsanitized request values. 206 206 */ … … 314 314 wp_nav_menu_post_type_meta_boxes(); 315 315 wp_nav_menu_taxonomy_meta_boxes(); 316 317 316 317 318 318 // Register advanced menu items (columns) 319 319 add_filter( 'manage_nav-menus_columns', 'wp_nav_menu_manage_columns'); 320 320 321 321 add_filter( 'columns_prefs_header', create_function( '', "return __('Show advanced menu properties');" )); 322 323 324 322 323 324 325 325 // If first time editing, disable advanced items by default. 326 326 if( false === get_user_option( 'managenav-menuscolumnshidden' ) ) { … … 423 423 424 424 $removed_args = array( 425 'action', 425 'action', 426 426 'customlink-tab', 427 427 'edit-menu-item', … … 477 477 $offset = 0 < $pagenum ? $per_page * ( $pagenum - 1 ) : 0; 478 478 479 $args = array( 480 'offset' => $offset, 479 $args = array( 480 'offset' => $offset, 481 481 'order' => 'ASC', 482 'orderby' => 'title', 483 'posts_per_page' => $per_page, 484 'post_type' => $post_type_name, 485 'suppress_filters' => true, 482 'orderby' => 'title', 483 'posts_per_page' => $per_page, 484 'post_type' => $post_type_name, 485 'suppress_filters' => true, 486 486 ); 487 487 … … 512 512 $parent_ids = array_unique($parent_ids); 513 513 $child_ids = array_unique($child_ids); 514 514 515 515 $missing_parents = array(); 516 516 do { … … 521 521 $parent_ids[] = $missing_parent->post_parent; 522 522 } 523 523 524 524 $missing_parents = array_filter( array_diff( array_unique( $parent_ids ), array_unique( $child_ids ) ) ); 525 525 526 526 } while( 0 < count( $missing_parents ) ); 527 527 528 528 } 529 529 530 530 $page_links = paginate_links( array( 531 'base' => add_query_arg( 531 'base' => add_query_arg( 532 532 array( 533 533 $post_type_name . '-tab' => 'all', … … 535 535 ) 536 536 ), 537 'format' => '', 537 'format' => '', 538 538 'prev_text' => __('«'), 539 539 'next_text' => __('»'), … … 541 541 'current' => $pagenum 542 542 )); 543 543 544 544 if ( !$posts ) 545 545 $error = '<li id="error">'. sprintf( __( 'No %s exists' ), $post_type['args']->label ) .'</li>'; … … 555 555 556 556 $removed_args = array( 557 'action', 557 'action', 558 558 'customlink-tab', 559 559 'edit-menu-item', … … 570 570 </ul> 571 571 572 <div class="tabs-panel <?php 572 <div class="tabs-panel <?php 573 573 echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); 574 574 ?>" id="tabs-panel-posttype-<?php echo $post_type_name; ?>-search"> 575 <?php 575 <?php 576 576 if ( isset( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) { 577 577 $searched = esc_attr( $_REQUEST['quick-search-posttype-' . $post_type_name] ); … … 615 615 if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) { 616 616 $checkbox_items = preg_replace('/(type=(.)checkbox(\2))/', '$1 checked=$2checked$2', $checkbox_items); 617 617 618 618 } 619 619 echo $checkbox_items; … … 628 628 <p class="button-controls"> 629 629 <span class="list-controls"> 630 <a href="<?php 630 <a href="<?php 631 631 echo add_query_arg( 632 632 array( … … 670 670 671 671 $args = array( 672 'child_of' => 0, 672 'child_of' => 0, 673 673 'exclude' => '', 674 'hide_empty' => false, 675 'hierarchical' => 1, 676 'include' => '', 677 'include_last_update_time' => false, 678 'number' => $per_page, 674 'hide_empty' => false, 675 'hierarchical' => 1, 676 'include' => '', 677 'include_last_update_time' => false, 678 'number' => $per_page, 679 679 'offset' => $offset, 680 680 'order' => 'ASC', 681 'orderby' => 'name', 681 'orderby' => 'name', 682 682 'pad_counts' => false, 683 683 ); … … 686 686 687 687 $page_links = paginate_links( array( 688 'base' => add_query_arg( 688 'base' => add_query_arg( 689 689 array( 690 690 $taxonomy_name . '-tab' => 'all', … … 692 692 ) 693 693 ), 694 'format' => '', 694 'format' => '', 695 695 'prev_text' => __('«'), 696 696 'next_text' => __('»'), … … 698 698 'current' => $pagenum 699 699 )); 700 700 701 701 $walker = new Walker_Nav_Menu_Checklist; 702 702 // @todo transient caching of these results with proper invalidation on updating of a tax of this type … … 716 716 717 717 $removed_args = array( 718 'action', 718 'action', 719 719 'customlink-tab', 720 720 'edit-menu-item', … … 741 741 echo walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $popular_terms), 0, (object) $args ); 742 742 ?> 743 <?php 743 <?php 744 744 ?> 745 745 </ul> 746 746 </div><!-- /.tabs-panel --> 747 747 748 <div class="tabs-panel <?php 748 <div class="tabs-panel <?php 749 749 echo ( 'search' == $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' ); 750 750 ?>" id="tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>"> 751 <?php 751 <?php 752 752 if ( isset( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ) ) { 753 753 $searched = esc_attr( $_REQUEST['quick-search-taxonomy-' . $taxonomy_name] ); … … 762 762 <input type="submit" class="quick-search-submit button-secondary" value="<?php esc_attr_e('Search'); ?>" /> 763 763 </p> 764 764 765 765 <ul id="<?php echo $taxonomy_name; ?>-search-checklist" class="list:<?php echo $taxonomy_name?> categorychecklist form-no-clear"> 766 766 <?php if ( ! empty( $search_results ) && ! is_wp_error( $search_results ) ) : ?> … … 796 796 <p class="button-controls"> 797 797 <span class="list-controls"> 798 <a href="<?php 798 <a href="<?php 799 799 echo add_query_arg( 800 800 array( … … 835 835 // Loop through all the menu items' POST values 836 836 foreach( (array) $menu_data as $_possible_db_id => $_item_object_data ) { 837 if ( 837 if ( 838 838 empty( $_item_object_data['menu-item-object-id'] ) && // checkbox is not checked 839 ( 840 ! isset( $_item_object_data['menu-item-type'] ) || // and item type either isn't set 839 ( 840 ! isset( $_item_object_data['menu-item-type'] ) || // and item type either isn't set 841 841 in_array( $_item_object_data['menu-item-url'], array( 'http://', '' ) ) || // or URL is the default 842 'custom' != $_item_object_data['menu-item-type'] || // or it's not a custom menu item 842 'custom' != $_item_object_data['menu-item-type'] || // or it's not a custom menu item 843 843 ! empty( $_item_object_data['menu-item-db-id'] ) // or it *is* a custom menu item that already exists 844 844 ) … … 848 848 849 849 // if this possible menu item doesn't actually have a menu database ID yet 850 if ( 850 if ( 851 851 empty( $_item_object_data['menu-item-db-id'] ) || 852 852 ( 0 > $_possible_db_id ) || … … 857 857 $_actual_db_id = (int) $_item_object_data['menu-item-db-id']; 858 858 } 859 859 860 860 $args = array( 861 861 'menu-item-db-id' => ( isset( $_item_object_data['menu-item-db-id'] ) ? $_item_object_data['menu-item-db-id'] : '' ), … … 886 886 * 887 887 * @since 3.0.0 888 * 888 * 889 889 * @access private 890 890 * … … 897 897 if ( 'attachment' == $object->name ) 898 898 return false; 899 899 900 900 // pages should show most recent 901 901 if ( 'page' == $object->name ) { … … 920 920 } 921 921 } 922 922 923 923 return $object; 924 924 } … … 934 934 function wp_get_nav_menu_to_edit( $menu_item_id = 0 ) { 935 935 $menu = wp_get_nav_menu_object( $menu_item_id ); 936 936 937 937 // If the menu exists, get its items. 938 938 if ( is_nav_menu( $menu ) ) { 939 939 $menu_items = wp_get_nav_menu_items( $menu->term_id, array('post_status' => 'any') ); 940 940 941 $walker = new Walker_Nav_Menu_Edit; 941 $walker = new Walker_Nav_Menu_Edit; 942 942 943 943 return walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $menu_items), 0, (object) array('walker' => $walker ) ); 944 944 } elseif ( is_wp_error( $menu ) ) { 945 return $menu; 945 return $menu; 946 946 } 947 947 -
trunk/wp-admin/includes/post.php
r14399 r14404 1199 1199 $now = time(); 1200 1200 1201 update_post_meta( $post->ID, '_edit_lock', $now ); 1201 update_post_meta( $post->ID, '_edit_lock', $now ); 1202 1202 } 1203 1203 -
trunk/wp-admin/includes/template.php
r14374 r14404 898 898 <?php 899 899 900 if ( post_type_supports( $screen->post_type, 'title' ) ) : 900 if ( post_type_supports( $screen->post_type, 'title' ) ) : 901 901 if ( $bulk ) : ?> 902 902 <div id="bulk-title-div"> … … 1032 1032 </label> 1033 1033 1034 <?php 1034 <?php 1035 1035 endif; // post_type_supports page-attributes 1036 1036 endif; // $post_type_object->hierarchical ?> -
trunk/wp-admin/includes/theme.php
r14393 r14404 211 211 /** 212 212 * Check the current theme for reliance on deprecated theme compatibility 213 * 213 * 214 214 * Check to see if the current theme has all the required templates available 215 215 * from itself or its parent 216 216 217 217 * @since 3.0 218 218 * @access private … … 221 221 function _check_theme_deprecated_files() { 222 222 $files = array( ); 223 223 224 224 if ( ! locate_template( array( 'header.php' ) ) ) 225 225 $files[] = 'header.php'; … … 228 228 if ( ! locate_template( array( 'sidebar.php' ) ) ) 229 229 $files[] = 'sidebar.php'; 230 231 // Only notify if both are missing as you can use one or the other 230 231 // Only notify if both are missing as you can use one or the other 232 232 if ( ! locate_template( array( 'comments.php' ) ) && ! locate_template( array( 'comments-popup.php' ) ) ) { 233 233 $files[] = 'comments.php'; 234 234 $files[] = 'comments-popup.php'; 235 } 236 235 } 236 237 237 if ( ! empty( $files ) ) : ?> 238 238 <div id="deprecated-files-message" class="error"><p> -
trunk/wp-admin/js/common.dev.js
r14286 r14404 145 145 }); 146 146 }, 147 147 148 148 checked : function(column) { 149 149 $('.column-' + column).show(); 150 150 }, 151 151 152 152 unchecked : function(column) { 153 153 $('.column-' + column).hide(); 154 154 }, 155 155 156 156 hidden : function() { 157 157 return $('.manage-column').filter(':hidden').map(function() { return this.id; }).get().join(','); 158 158 }, 159 159 160 160 useCheckboxesForHidden : function() { 161 161 this.hidden = function(){ -
trunk/wp-admin/js/custom-background.dev.js
r13856 r14404 28 28 jQuery('#custom-background-image').css('background-repeat', jQuery(this).val()); 29 29 }); 30 30 31 31 farbtastic = jQuery.farbtastic('#colorPickerDiv', function(color) { 32 32 pickColor(color); -
trunk/wp-admin/js/nav-menu.dev.js
r14394 r14404 11 11 var WPNavMenuHandler = function ($) { 12 12 var autoCompleteData = {}, 13 13 14 14 menuItemDepthPerLevel = 30, // Do not use directly. Use depthToPx and pxToDepth instead. 15 15 globalMaxDepth = 11, … … 33 33 } 34 34 }, 35 35 36 36 getListDataFromID = function(menuItemID, parentEl) { 37 if ( ! menuItemID ) 37 if ( ! menuItemID ) 38 38 return false; 39 39 parentEl = parentEl || document; … … 63 63 j = fields.length; 64 64 while ( j-- ) { 65 if ( 65 if ( 66 66 inputs[i] && 67 67 inputs[i].name && 68 'menu-item[' + menuItemID + '][' + fields[j] + ']' == inputs[i].name 68 'menu-item[' + menuItemID + '][' + fields[j] + ']' == inputs[i].name 69 69 ) { 70 70 itemData[fields[j]] = inputs[i].value; … … 75 75 return itemData; 76 76 }, 77 77 78 78 recalculateMenuItemPositions = function() { 79 79 menuList.find('.menu-item-data-position').val( function(index) { return index + 1; } ); 80 80 }, 81 81 82 82 depthToPx = function(depth) { 83 83 return depth * menuItemDepthPerLevel; 84 84 }, 85 85 86 86 pxToDepth = function(px) { 87 87 return Math.floor(px / menuItemDepthPerLevel); … … 89 89 90 90 menuList; 91 91 92 92 // jQuery extensions 93 93 $.fn.extend({ … … 150 150 151 151 return { 152 152 153 153 // Functions that run on init. 154 154 init : function() { 155 155 menuList = $('#menu-to-edit'); 156 156 157 157 this.attachMenuEditListeners(); 158 158 159 159 this.attachMenuMetaListeners(document.getElementById('nav-menu-meta')); 160 160 161 161 this.attachTabsPanelListeners(); 162 162 163 163 if( menuList.length ) // If no menu, we're in the + tab. 164 164 this.initSortables(); 165 165 166 166 this.initToggles(); 167 167 168 168 this.initTabManager(); 169 169 }, 170 170 171 171 initToggles : function() { 172 172 // init postboxes 173 173 postboxes.add_postbox_toggles('nav-menus'); 174 174 175 175 // adjust columns functions for menus UI 176 176 columns.useCheckboxesForHidden(); … … 184 184 menuList.hideAdvancedMenuItemFields(); 185 185 }, 186 186 187 187 initSortables : function() { 188 188 var currentDepth = 0, originalDepth, minDepth, maxDepth, 189 189 menuLeft = menuList.offset().left; 190 190 191 191 menuList.sortable({ 192 192 handle: ' > dl', … … 195 195 var next, height, width, parent, children, maxChildDepth, 196 196 transport = ui.item.children('.menu-item-transport'); 197 197 198 198 // Set depths 199 199 originalDepth = ui.item.menuItemDepth(); 200 200 updateCurrentDepth(ui, originalDepth); 201 201 202 202 // Attach child elements to parent 203 203 // Skip the placeholder … … 208 208 // Now that the element is complete, we can update... 209 209 updateDepthRange(ui); 210 210 211 211 // Update the height of the placeholder to match the moving item. 212 212 height = transport.outerHeight(); … … 216 216 height -= 2; // Subtract 2 for borders 217 217 ui.placeholder.height(height); 218 218 219 219 // Update the width of the placeholder to match the moving item. 220 220 maxChildDepth = originalDepth; … … 230 230 stop: function(e, ui) { 231 231 var children, depthChange = currentDepth - originalDepth; 232 232 233 233 // Return child elements to the list 234 234 children = ui.item.children('.menu-item-transport').children().insertAfter(ui.item); 235 235 236 236 // Update depth classes 237 237 if( depthChange != 0 ) { … … 248 248 if( ! ui.placeholder.parent().hasClass('menu') ) 249 249 ui.placeholder.appendTo(menuList); 250 250 251 251 updateDepthRange(ui); 252 252 }, … … 256 256 if ( depth < minDepth ) depth = minDepth; 257 257 else if ( depth > maxDepth ) depth = maxDepth; 258 258 259 259 if( depth != currentDepth ) 260 260 updateCurrentDepth(ui, depth); 261 261 } 262 262 }); 263 263 264 264 function updateDepthRange(ui) { 265 265 var prev = ui.placeholder.prev(), 266 266 next = ui.placeholder.next(), depth; 267 267 268 268 // Make sure we don't select the moving item. 269 if( prev[0] == ui.item[0] ) prev = prev.prev(); 269 if( prev[0] == ui.item[0] ) prev = prev.prev(); 270 270 if( next[0] == ui.item[0] ) next = next.next(); 271 271 272 272 minDepth = (next.length) ? next.menuItemDepth() : 0; 273 273 274 274 if( prev.length ) 275 275 maxDepth = ( (depth = prev.menuItemDepth() + 1) > globalMaxDepth ) ? globalMaxDepth : depth; … … 277 277 maxDepth = 0; 278 278 } 279 279 280 280 function updateCurrentDepth(ui, depth) { 281 281 ui.placeholder.updateDepthClass( depth, currentDepth ); … … 283 283 } 284 284 }, 285 285 286 286 attachMenuEditListeners : function() { 287 287 var that = this; … … 300 300 }); 301 301 }, 302 302 303 303 /** 304 304 * An interface for managing default values for input elements … … 310 310 setupInputWithDefaultTitle : function() { 311 311 var name = 'input-with-default-title'; 312 312 313 313 $('.' + name).each( function(){ 314 314 var $t = $(this), title = $t.attr('title'), val = $t.val(); 315 315 $t.data( name, title ); 316 316 317 317 if( '' == val ) $t.val( title ); 318 318 else if ( title == val ) return; … … 335 335 var that = this; 336 336 this.setupInputWithDefaultTitle(); 337 337 338 338 // auto-suggest for the quick-search boxes 339 339 $('input.quick-search').each(function(i, el) { 340 that.setupQuickSearchEventListeners(el); 341 }); 342 340 that.setupQuickSearchEventListeners(el); 341 }); 342 343 343 $(formEL).bind('submit', function(e) { 344 344 return that.eventSubmitMetaForm.call(that, this, e); 345 345 }); 346 $(formEL).find('input:submit').click(function() { 347 $(this).siblings('img.waiting').show(); 346 $(formEL).find('input:submit').click(function() { 347 $(this).siblings('img.waiting').show(); 348 348 }); 349 349 }, … … 360 360 361 361 // upon changing tabs, we want to uncheck all checkboxes 362 while( i-- ) 362 while( i-- ) 363 363 inputs[i].checked = false; 364 364 … … 380 380 } 381 381 } 382 382 383 383 return false; 384 384 } else if ( e.target && e.target.className && -1 != e.target.className.indexOf('select-all') ) { … … 391 391 }); 392 392 }, 393 393 394 394 initTabManager : function() { 395 395 var fixed = $('.nav-tabs-wrapper'), … … 401 401 arrowLeft, arrowRight 402 402 resizing = false; 403 403 404 404 function resetMenuTabs() { 405 405 fixedLeft = fixed.offset().left; … … 407 407 active.makeTabVisible(); 408 408 } 409 409 410 410 $.fn.extend({ 411 411 makeTabVisible : function() { … … 427 427 } 428 428 }); 429 429 430 430 // Find the width of all tabs 431 431 tabs.each(function(){ 432 432 tabsWidth += $(this).outerWidth(true); 433 433 }); 434 434 435 435 // Check if we need the tab manager 436 436 if( tabsWidth <= fixed.width() … … 438 438 - fluid.css('padding-right').slice(0,-2) ) 439 439 return; 440 440 441 441 // Set up right margin for overflow, unset padding 442 442 fluid.css({ … … 444 444 'padding' : 0, 445 445 }); 446 446 447 447 // Build tab navigation 448 448 arrowLeft = $('<div class="nav-tabs-arrow nav-tabs-arrow-left"><a>«</a></div>'); … … 450 450 // Attach to the document 451 451 fixed.wrap('<div class="nav-tabs-nav"/>').parent().prepend( arrowLeft ).append( arrowRight ); 452 452 453 453 // Set the menu tabs 454 454 resetMenuTabs(); … … 457 457 if( resizing ) return; 458 458 resizing = true; 459 setTimeout(function(){ 459 setTimeout(function(){ 460 460 resetMenuTabs(); 461 461 resizing = false; 462 462 }, 1000); 463 463 }); 464 465 // Build arrow functions 464 465 // Build arrow functions 466 466 $.each([{ 467 467 arrow : arrowLeft, … … 502 502 setupQuickSearchEventListeners : function(el) { 503 503 var that = this; 504 $(el).autocomplete( ajaxurl + '?action=menu-quick-search&type=' + el.name, 505 { 506 delay: 500, 504 $(el).autocomplete( ajaxurl + '?action=menu-quick-search&type=' + el.name, 505 { 506 delay: 500, 507 507 formatItem: formatAutocompleteResponse, 508 508 formatResult: formatAutocompleteResult, 509 minchars: 2, 510 multiple: false 509 minchars: 2, 510 multiple: false 511 511 } 512 512 ).bind('blur', function(e) { … … 514 514 inputEl = this; 515 515 if ( changedData ) { 516 $.post( 516 $.post( 517 517 ajaxurl + '?action=menu-quick-search&type=get-post-item&response-format=markup', 518 518 changedData, 519 519 function(r) { 520 that.processQuickSearchQueryResponse.call(that, r, changedData); 520 that.processQuickSearchQueryResponse.call(that, r, changedData); 521 521 autoCompleteData[inputEl.value] = false; 522 522 } … … 547 547 } 548 548 }, 549 549 550 550 eventOnClickCloseLink : function(clickedEl) { 551 551 $(clickedEl).closest('.menu-item-settings').siblings('dl').find('.item-edit').click(); 552 552 return false; 553 553 }, 554 554 555 555 eventOnClickMenuDelete : function(clickedEl) { 556 556 // Delete warning AYS … … 571 571 matchedSection = /_wpnonce=([a-zA-Z0-9]*)$/.exec(clickedEl.href); 572 572 if ( matchedSection && matchedSection[1] ) { 573 itemID = parseInt(clickedEl.id.replace('delete-', ''), 10); 573 itemID = parseInt(clickedEl.id.replace('delete-', ''), 10); 574 574 $.post( 575 575 ajaxurl, … … 584 584 } 585 585 ); 586 return false; 586 return false; 587 587 } 588 588 return true; … … 630 630 listItemDBID = 'undefined' == typeof listItemDBIDMatch[1] ? 0 : parseInt(listItemDBIDMatch[1], 10); 631 631 listItemData = getListDataFromID(listItemDBID); 632 632 633 633 for ( j in listItemData ) { 634 634 params['menu-item[' + listItemDBID + '][' + j + ']'] = listItemData[j]; … … 655 655 656 656 $.post( ajaxurl, params, function(menuMarkup) { 657 processMethod.call(that, menuMarkup, params); 657 processMethod.call(that, menuMarkup, params); 658 658 $(thisForm).find('img.waiting').hide(); 659 659 }); … … 678 678 /** 679 679 * Process the quick search response into a search result 680 * 680 * 681 681 * @param string resp The server response to the query. 682 682 * @param object req The request arguments. … … 709 709 710 710 wrap.innerHTML = resp; 711 711 712 712 items = wrap.getElementsByTagName('li'); 713 713 … … 739 739 el = $(el) 740 740 var children = el.childMenuItems(); 741 741 742 742 el.addClass('deleting').fadeOut( 350 , function() { 743 743 el.remove(); -
trunk/wp-admin/js/theme-preview.dev.js
r14030 r14404 51 51 $('#TB_iframeContent').width('100%'); 52 52 thickDims(); 53 53 54 54 return false; 55 55 } ); -
trunk/wp-admin/ms-delete-site.php
r14374 r14404 16 16 if ( ! current_user_can( 'manage_options' ) ) 17 17 wp_die(__( 'You do not have sufficient permissions to delete this site.')); 18 18 19 19 if ( isset( $_GET['h'] ) && $_GET['h'] != '' && get_option( 'delete_blog_hash' ) != false ) { 20 20 if ( get_option( 'delete_blog_hash' ) == $_GET['h'] ) { -
trunk/wp-admin/ms-edit.php
r14374 r14404 330 330 if ( ! current_user_can( 'manage_sites' ) ) 331 331 wp_die( __( 'You do not have permission to access this page.' ) ); 332 332 333 333 if ( $_GET['action'] != -1 || $_POST['action2'] != -1 ) 334 334 $doaction = $_POST['action'] != -1 ? $_POST['action'] : $_POST['action2']; … … 455 455 header( 'Content-Type: text/html; charset=utf-8' ); 456 456 } 457 if ( $current_site->blog_id == $id ) 457 if ( $current_site->blog_id == $id ) 458 458 wp_die( __( 'You are not allowed to change the current site.' ) ); 459 459 ?> … … 490 490 if ( $id != '0' && $id != '1' ) { 491 491 $_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle with arrays 492 $title = __( 'Users' ); 493 $parent_file = 'ms-admin.php'; 492 $title = __( 'Users' ); 493 $parent_file = 'ms-admin.php'; 494 494 require_once( 'admin-header.php' ); 495 495 echo '<div class="wrap">'; … … 499 499 exit(); 500 500 } else { 501 wp_redirect( admin_url( 'ms-users.php' ) ); 501 wp_redirect( admin_url( 'ms-users.php' ) ); 502 502 } 503 503 break; … … 517 517 switch ( $doaction ) { 518 518 case 'delete': 519 $title = __( 'Users' ); 520 $parent_file = 'ms-admin.php'; 519 $title = __( 'Users' ); 520 $parent_file = 'ms-admin.php'; 521 521 require_once( 'admin-header.php' ); 522 522 echo '<div class="wrap">'; … … 544 544 $userfunction = 'all_notspam'; 545 545 $blogs = get_blogs_of_user( $val, true ); 546 foreach ( (array) $blogs as $key => $details ) 546 foreach ( (array) $blogs as $key => $details ) 547 547 update_blog_status( $details->userblog_id, 'spam', '0' ); 548 548 549 549 update_user_status( $val, 'spam', '0', 1 ); 550 550 break; 551 } 552 } 551 } 552 } 553 553 } 554 554 … … 579 579 foreach( $_POST['user'] as $id ) { 580 580 wpmu_delete_user( $id ); 581 $i++; 581 $i++; 582 582 } 583 583 -
trunk/wp-admin/ms-options.php
r14374 r14404 93 93 <td><input name="admin_notice_feed" class="large-text" type="text" id="admin_notice_feed" value="<?php echo esc_attr( get_site_option( 'admin_notice_feed' ) ) ?>" size="80" /><br /> 94 94 <?php _e( 'Display the latest post from this RSS or Atom feed on all site dashboards. Leave blank to disable.' ); ?><br /> 95 95 96 96 <?php if ( get_site_option( 'admin_notice_feed' ) != get_home_url( $current_site->id, 'feed/' ) ) 97 97 echo __( 'A good one to use would be the feed from your main site: ' ) . esc_url( get_home_url( $current_site->id, 'feed/' ) ) ?></td> -
trunk/wp-admin/ms-users.php
r14374 r14404 256 256 break; 257 257 258 case 'registered': 258 case 'registered': 259 259 if ( 'list' == $mode ) 260 260 $date = 'Y/m/d'; … … 285 285 echo 'style="background-color: #faa" '; 286 286 echo 'href="' . esc_url( get_home_url( $val->userblog_id ) ) . '">' . __( 'View' ) . '</a>'; 287 287 288 288 echo '</small><br />'; 289 289 } -
trunk/wp-admin/my-sites.php
r14374 r14404 32 32 $updated = true; 33 33 } else { 34 wp_die( __( 'The primary site you chose does not exist.' ) ); 34 wp_die( __( 'The primary site you chose does not exist.' ) ); 35 35 } 36 36 } -
trunk/wp-admin/nav-menus.php
r14368 r14404 108 108 $dbids_to_objectids[$ordered_menu_item_object->ID] = $possible_object_id; 109 109 $objectids_to_dbids[$possible_object_id] = $ordered_menu_item_object->ID; 110 } 110 } 111 111 } 112 112 } … … 115 115 // if this menu item is not first 116 116 if ( ! empty( $dbids_to_orders[$menu_item_id] ) && ! empty( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) ) { 117 117 118 118 // if this menu item is a child of the previous 119 if ( 120 ! empty( $menu_item_data['post_parent'] ) && 119 if ( 120 ! empty( $menu_item_data['post_parent'] ) && 121 121 isset( $objectids_to_dbids[$menu_item_data['post_parent']] ) && 122 122 isset( $orders_to_dbids[$dbids_to_orders[$menu_item_id] - 1] ) && … … 128 128 129 129 if ( ! is_wp_error( $parent_data ) ) { 130 130 131 131 // if there is something before the parent, make menu item a child of the parent's parent 132 132 if ( ! empty( $dbids_to_orders[$parent_db_id] ) && ! empty( $orders_to_dbids[$dbids_to_orders[$parent_db_id] - 1] ) ) { … … 137 137 $menu_item_data['post_parent'] = 0; 138 138 } 139 139 140 140 // set former parent's [menu_order] to that of menu-item's 141 141 $parent_data['menu_order'] = $parent_data['menu_order'] + 1; … … 143 143 // set menu-item's [menu_order] to that of former parent 144 144 $menu_item_data['menu_order'] = $menu_item_data['menu_order'] - 1; 145 145 146 146 // save changes 147 147 wp_update_post($menu_item_data); … … 169 169 if ( is_nav_menu_item( $menu_item_id ) ) { 170 170 if ( wp_delete_post( $menu_item_id, true ) ) { 171 171 172 172 $messages[] = '<div id="message" class="updated"><p>' . __('The menu item has been successfully deleted.') . '</p></div>'; 173 173 } … … 249 249 $menu_item_db_id = wp_update_nav_menu_item( $nav_menu_selected_id, ( $_POST['menu-item-db-id'][$_key] != $_key ? 0 : $_key ), $args ); 250 250 251 if ( is_wp_error( $menu_item_db_id ) ) 251 if ( is_wp_error( $menu_item_db_id ) ) 252 252 $messages[] = '<div id="message" class="error"><p>' . $menu_item_db_id->get_error_message() . '</p></div>'; 253 253 elseif ( isset( $menu_items[$menu_item_db_id] ) ) … … 328 328 <?php screen_icon(); ?> 329 329 <h2><?php esc_html_e('Menus'); ?></h2> 330 <?php 330 <?php 331 331 foreach( $messages as $message ) : 332 echo $message . "\n"; 332 echo $message . "\n"; 333 333 endforeach; 334 334 ?> 335 335 336 336 <?php if ( current_theme_supports('nav-menus') || current_theme_supports('widgets') ) : ?> 337 337 <div id="nav-menus-frame"> … … 365 365 <div class="nav-tabs-wrapper"> 366 366 <div class="nav-tabs"> 367 <?php 367 <?php 368 368 foreach( (array) $nav_menus as $_nav_menu ) : 369 370 ?><a href="<?php 369 370 ?><a href="<?php 371 371 echo add_query_arg( 372 372 array( … … 376 376 admin_url( 'nav-menus.php' ) 377 377 ); 378 ?>" class="nav-tab<?php 379 if ( $nav_menu_selected_id == $_nav_menu->term_id ) 378 ?>" class="nav-tab<?php 379 if ( $nav_menu_selected_id == $_nav_menu->term_id ) 380 380 echo ' nav-tab-active'; 381 381 else … … 383 383 ?>"><?php echo esc_html( $_nav_menu->name ); ?></a><?php 384 384 endforeach; 385 ?><a href="<?php 385 ?><a href="<?php 386 386 echo add_query_arg( 387 387 array( … … 391 391 admin_url( 'nav-menus.php' ) 392 392 ); 393 ?>" class="nav-tab menu-add-new<?php 394 if ( 0 == $nav_menu_selected_id ) 393 ?>" class="nav-tab menu-add-new<?php 394 if ( 0 == $nav_menu_selected_id ) 395 395 echo ' nav-tab-active'; 396 396 ?>"><?php printf( '<abbr title="%s">+</abbr>', esc_html__( 'Add menu' ) ); ?></a> … … 407 407 <br class="clear" /> 408 408 </label> 409 409 410 410 <div class="publishing-action"> 411 411 <input class="button-primary" name="save_menu" type="submit" value="<?php empty($nav_menu_selected_id) ? esc_attr_e('Create Menu') : esc_attr_e('Save Menu'); ?>" /> 412 412 </div><!--END .publishing-action--> 413 413 414 414 <?php if ( ! empty( $nav_menu_selected_id ) ) : ?> 415 415 <div class="delete-action"> … … 430 430 <?php if ( is_nav_menu( $nav_menu_selected_id ) && ( current_theme_supports('nav-menus') || current_theme_supports('widgets') ) ) : ?> 431 431 <ul class="menu" id="menu-to-edit"> 432 <?php 433 $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id ); 432 <?php 433 $edit_markup = wp_get_nav_menu_to_edit( $nav_menu_selected_id ); 434 434 if ( ! is_wp_error( $edit_markup ) ) { 435 435 echo $edit_markup; -
trunk/wp-admin/press-this.php
r14374 r14404 487 487 <div class="inside"> 488 488 <div id="taxonomy-category" class="categorydiv"> 489 489 490 490 <ul id="category-tabs" class="category-tabs"> 491 491 <li class="tabs"><a href="#category-all" tabindex="3"><?php printf( __( 'All %s' ), $tax->label ); ?></a></li> -
trunk/wp-admin/setup-config.php
r14363 r14404 161 161 $prefix = 'wp_'; 162 162 163 // Validate $prefix: it can only contain letters, numbers and underscores 164 if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) 165 wp_die( /*WP_I18N_BAD_PREFIX*/'<strong>ERROR</strong>: "Table Prefix" can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/ ); 163 // Validate $prefix: it can only contain letters, numbers and underscores 164 if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) 165 wp_die( /*WP_I18N_BAD_PREFIX*/'<strong>ERROR</strong>: "Table Prefix" can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/ ); 166 166 167 167 // Test the db connection. -
trunk/wp-includes/canonical.php
r14355 r14404 87 87 if ( $id && $redirect_url = get_permalink($id) ) 88 88 $redirect['query'] = remove_query_arg(array('p', 'page_id', 'attachment_id'), $redirect['query']); 89 89 90 90 if ( ! $redirect_url ) 91 91 $redirect_url = redirect_guess_404_permalink(); -
trunk/wp-includes/capabilities.php
r14256 r14404 1181 1181 * 1182 1182 * @since 3.0.0 1183 * 1183 * 1184 1184 * @uses $super_admins Super admins global variable, if set. 1185 * 1185 * 1186 1186 * @return array List of super admin logins 1187 1187 */ -
trunk/wp-includes/category-template.php
r13943 r14404 474 474 $r['exclude'] = ''; 475 475 } 476 476 477 477 if ( !isset( $r['class'] ) ) 478 478 $r['class'] = ( 'category' == $r['taxonomy'] ) ? 'categories' : $r['taxonomy']; -
trunk/wp-includes/class-http.php
r14363 r14404 392 392 function processResponse($strResponse) { 393 393 $res = explode("\r\n\r\n", $strResponse, 2); 394 394 395 395 return array('headers' => isset($res[0]) ? $res[0] : array(), 'body' => isset($res[1]) ? $res[1] : ''); 396 396 } -
trunk/wp-includes/class-oembed.php
r14249 r14404 169 169 $provider = add_query_arg( 'maxheight', $args['height'], $provider ); 170 170 $provider = add_query_arg( 'url', urlencode($url), $provider ); 171 171 172 172 foreach( array( 'json', 'xml' ) as $format ) { 173 173 $result = $this->_fetch_with_format( $provider, $format ); -
trunk/wp-includes/comment-template.php
r14378 r14404 1258 1258 * the highest depth level displayed. This prevents them being orphaned 1259 1259 * at the end of the comment list. 1260 * 1260 * 1261 1261 * Example: max_depth = 2, with 5 levels of nested content. 1262 1262 * 1 -
trunk/wp-includes/formatting.php
r14381 r14404 53 53 $cockneyreplace = array("’tain’t","’twere","’twas","’tis","’twill","’til","’bout","’nuff","’round","’cause"); 54 54 } 55 55 56 56 $static_characters = array_merge(array('---', ' -- ', '--', ' - ', 'xn–', '...', '``', '\'\'', ' (tm)'), $cockney); 57 57 $static_replacements = array_merge(array('—', ' — ', '–', ' – ', 'xn--', '…', $opening_quote, $closing_quote, ' ™'), $cockneyreplace); 58 58 59 59 $dynamic_characters = array('/\'(\d\d(?:’|\')?s)/', '/\'(\d+)/', '/(\s|\A|[([{<]|")\'/', '/(\d+)"/', '/(\d+)\'/', '/(\S)\'([^\'\s])/', '/(\s|\A|[([{<])"(?!\s)/', '/"(\s|\S|\Z)/', '/\'([\s.]|\Z)/', '/\b(\d+)x(\d+)\b/'); 60 60 $dynamic_replacements = array('’$1','’$1', '$1‘', '$1″', '$1′', '$1’$2', '$1' . $opening_quote . '$2', $closing_quote . '$1', '’$1', '$1×$2'); -
trunk/wp-includes/functions.php
r14370 r14404 2913 2913 * @param array $list An array of objects to filter 2914 2914 * @param array $args An array of key => value arguments to match against each object 2915 * @param string $operator The logical operation to perform. 'or' means only one element 2915 * @param string $operator The logical operation to perform. 'or' means only one element 2916 2916 * from the array needs to match; 'and' means all elements must match. The default is 'and'. 2917 2917 * @param bool|string $field A field from the object to place instead of the entire object -
trunk/wp-includes/locale.php
r14360 r14404 182 182 $trans = __('number_format_thousands_sep'); 183 183 $this->number_format['thousands_sep'] = ('number_format_thousands_sep' == $trans) ? ',' : $trans; 184 184 185 185 /* translators: $dec_point argument for http://php.net/number_format, default is . */ 186 186 $trans = __('number_format_decimal_point'); -
trunk/wp-includes/ms-functions.php
r14374 r14404 1326 1326 if ( empty( $details ) || is_wp_error( add_existing_user_to_blog( $details ) ) ) 1327 1327 wp_die( sprintf(__('An error occurred adding you to this site. Back to the <a href="%s">homepage</a>.'), site_url() ) ); 1328 1328 1329 1329 wp_die( sprintf(__('You have been added to this site. Please visit the <a href="%s">homepage</a> or <a href="%s">login</a> using your username and password.'), site_url(), admin_url() ), __('Success') ); 1330 1330 } -
trunk/wp-includes/nav-menu-template.php
r14293 r14404 85 85 86 86 $output .= $indent . '<li id="menu-item-'. $item->ID . '"' . $value . $classes .'>'; 87 87 88 88 $attributes = ! empty( $item->attr_title ) ? ' title="' . esc_attr( $item->attr_title ) .'"' : ''; 89 89 $attributes .= ! empty( $item->target ) ? ' target="' . esc_attr( $item->target ) .'"' : ''; … … 96 96 $item_output .= '</a>'; 97 97 $item_output .= $args->after; 98 98 99 99 $output .= apply_filters( 'wp_get_nav_menu_item', $item_output, $args ); 100 100 } … … 209 209 } 210 210 } 211 211 212 212 // If the menu exists, get its items. 213 213 if ( $menu && ! is_wp_error($menu) ) … … 220 220 } 221 221 } 222 222 223 223 $nav_menu = ''; 224 224 $items = ''; … … 237 237 $items .= walk_nav_menu_tree( $sorted_menu_items, $args->depth, $args ); 238 238 239 // Attributes 239 // Attributes 240 240 $attributes = ' id="menu-' . $menu->slug . '"'; 241 241 $attributes .= $args->menu_class ? ' class="'. $args->menu_class .'"' : ''; 242 242 243 243 $nav_menu .= '<ul'. $attributes .'>'; 244 244 -
trunk/wp-includes/nav-menu.php
r14297 r14404 17 17 */ 18 18 function wp_get_nav_menu_object( $menu ) { 19 if ( ! $menu ) 19 if ( ! $menu ) 20 20 return false; 21 21 … … 48 48 if ( ! $menu ) 49 49 return false; 50 50 51 51 $menu_obj = wp_get_nav_menu_object( $menu ); 52 52 53 if ( 54 $menu_obj && 55 ! is_wp_error( $menu_obj ) && 53 if ( 54 $menu_obj && 55 ! is_wp_error( $menu_obj ) && 56 56 ! empty( $menu_obj->taxonomy ) && 57 57 'nav_menu' == $menu_obj->taxonomy 58 ) 58 ) 59 59 return true; 60 60 61 61 return false; 62 62 } … … 164 164 165 165 if ( $_menu && isset( $_menu->term_id ) ) { 166 $args = array( 167 'description' => ( isset( $menu_data['description'] ) ? $menu_data['description'] : '' ), 168 'name' => ( isset( $menu_data['menu-name'] ) ? $menu_data['menu-name'] : '' ), 169 'parent' => ( isset( $menu_data['parent'] ) ? (int) $menu_data['parent'] : 0 ), 170 'slug' => null, 166 $args = array( 167 'description' => ( isset( $menu_data['description'] ) ? $menu_data['description'] : '' ), 168 'name' => ( isset( $menu_data['menu-name'] ) ? $menu_data['menu-name'] : '' ), 169 'parent' => ( isset( $menu_data['parent'] ) ? (int) $menu_data['parent'] : 0 ), 170 'slug' => null, 171 171 ); 172 172 173 173 $menu_id = (int) $_menu->term_id; 174 174 175 175 // double-check that we're not changing a menu to the name of another 176 $_possible_existing = get_term_by( 'name', $menu_data['menu-name'], 'nav_menu' ); 177 if ( 178 $_possible_existing && 179 ! is_wp_error( $_possible_existing ) && 176 $_possible_existing = get_term_by( 'name', $menu_data['menu-name'], 'nav_menu' ); 177 if ( 178 $_possible_existing && 179 ! is_wp_error( $_possible_existing ) && 180 180 isset( $_possible_existing->term_id ) && 181 $_possible_existing->term_id != $menu_id 181 $_possible_existing->term_id != $menu_id 182 182 ) { 183 183 return new WP_Error( 'menu_exists', sprintf( __('The menu name <strong>%s</strong> conflicts with another menu name. Please try another.'), esc_html( $menu_data['menu-name'] ) ) ); … … 256 256 } 257 257 } 258 258 259 259 if ( 'custom' != $args['menu-item-type'] ) { 260 260 /* if non-custom menu item, then: … … 298 298 'post_content' => $args['menu-item-description'], 299 299 'post_excerpt' => $args['menu-item-attr-title'], 300 'post_parent' => $args['menu-item-parent-id'], 301 'post_title' => $args['menu-item-title'], 302 'post_type' => 'nav_menu_item', 300 'post_parent' => $args['menu-item-parent-id'], 301 'post_title' => $args['menu-item-title'], 302 'post_type' => 'nav_menu_item', 303 303 'tax_input' => array( 'nav_menu' => $menu->name ), 304 304 ); … … 377 377 378 378 if ( $a->$_menu_item_sort_prop == $b->$_menu_item_sort_prop ) { 379 return 0; 380 } elseif ( 381 ( $_a == $a->$_menu_item_sort_prop ) && 382 ( $_b == $b->$_menu_item_sort_prop ) 379 return 0; 380 } elseif ( 381 ( $_a == $a->$_menu_item_sort_prop ) && 382 ( $_b == $b->$_menu_item_sort_prop ) 383 383 ) { 384 384 return $_a < $_b ? -1 : 1; … … 405 405 if ( ! $menu ) 406 406 return false; 407 407 408 408 $items = get_objects_in_term( $menu->term_id, 'nav_menu' ); 409 409 … … 449 449 * - title: The title of this menu item. 450 450 * - target: The target attribute of the link element for this menu item. 451 * - attr_title: The title attribute of the link element for this menu item. 451 * - attr_title: The title attribute of the link element for this menu item. 452 452 * - classes: The class attribute value for the link element of this menu item. 453 453 * - xfn: The XFN relationship expressed in the link of this menu item. … … 466 466 $menu_item->object = get_post_meta( $menu_item->ID, '_menu_item_object', true ); 467 467 $menu_item->type = get_post_meta( $menu_item->ID, '_menu_item_type', true ); 468 468 469 469 if ( 'post_type' == $menu_item->type ) { 470 470 $object = get_post_type_object( $menu_item->object ); 471 471 $menu_item->append = $object->singular_label; 472 472 $menu_item->url = get_permalink( $menu_item->object_id ); 473 473 474 474 $original_object = get_post( $menu_item->object_id ); 475 475 $original_title = $original_object->post_title; … … 489 489 $menu_item->url = get_post_meta( $menu_item->ID, '_menu_item_url', true ); 490 490 } 491 491 492 492 $menu_item->target = get_post_meta( $menu_item->ID, '_menu_item_target', true ); 493 493 … … 543 543 * 544 544 * @since 3.0.0 545 * 545 * 546 546 * @param int $object_id The ID of the original object. 547 547 * @param string $object_type The type of object, such as "taxonomy" or "post_type." -
trunk/wp-includes/post.php
r14399 r14404 633 633 * @param array|string $args An array of key => value arguments to match against the post status objects. 634 634 * @param string $output The type of output to return, either post status 'names' or 'objects'. 'names' is the default. 635 * @param string $operator The logical operation to perform. 'or' means only one element 635 * @param string $operator The logical operation to perform. 'or' means only one element 636 636 * from the array needs to match; 'and' means all elements must match. The default is 'and'. 637 637 * @return array A list of post type names or objects … … 739 739 * @param array|string $args An array of key => value arguments to match against the post type objects. 740 740 * @param string $output The type of output to return, either post type 'names' or 'objects'. 'names' is the default. 741 * @param string $operator The logical operation to perform. 'or' means only one element 741 * @param string $operator The logical operation to perform. 'or' means only one element 742 742 * from the array needs to match; 'and' means all elements must match. The default is 'and'. 743 743 * @return array A list of post type names or objects -
trunk/wp-includes/query.php
r14402 r14404 1720 1720 $q['name'] = $q[ $ptype_obj->query_var ]; 1721 1721 } else { 1722 // Hierarchical post_types will operate through the 1722 // Hierarchical post_types will operate through the 1723 1723 $q['pagename'] = $q[ $ptype_obj->query_var ]; 1724 1724 $q['name'] = ''; … … 2483 2483 foreach ( $stickies as $sticky_post ) { 2484 2484 // Ignore sticky posts the current user cannot read or are not published. 2485 if ( 'publish' != $sticky_post->post_status ) 2485 if ( 'publish' != $sticky_post->post_status ) 2486 2486 continue; 2487 2487 array_splice($this->posts, $sticky_offset, 0, array($sticky_post)); -
trunk/wp-includes/rewrite.php
r14273 r14404 1568 1568 $home_path = parse_url( home_url() ); 1569 1569 $robots_rewrite = ( empty( $home_path['path'] ) || '/' == $home_path['path'] ) ? array( 'robots\.txt$' => $this->index . '?robots=1' ) : array(); 1570 1570 1571 1571 // Default Feed rules - These are require to allow for the direct access files to work with permalink structure starting with %category% 1572 1572 $default_feeds = array( '.*wp-atom.php$' => $this->index . '?feed=atom', -
trunk/wp-includes/taxonomy.php
r14234 r14404 70 70 * @param array $args An array of key => value arguments to match against the taxonomy objects. 71 71 * @param string $output The type of output to return, either taxonomy 'names' or 'objects'. 'names' is the default. 72 * @param string $operator The logical operation to perform. 'or' means only one element 72 * @param string $operator The logical operation to perform. 'or' means only one element 73 73 * from the array needs to match; 'and' means all elements must match. The default is 'and'. 74 74 * @return array A list of taxonomy names or objects … … 1572 1572 1573 1573 // Seems unreachable, However, Is used in the case that a term name is provided, which sanitizes to an empty string. 1574 if ( empty($slug) ) { 1574 if ( empty($slug) ) { 1575 1575 $slug = sanitize_title($slug, $term_id); 1576 1576 do_action( 'edit_terms', $term_id ); -
trunk/wp-includes/theme.php
r14365 r14404 845 845 /** 846 846 * Retrieve path of home template in current or parent template. 847 * 847 * 848 848 * This is the template used for the page containing the blog posts 849 * 849 * 850 850 * Attempts to locate 'home.php' first before falling back to 'index.php'. 851 851 * -
trunk/wp-includes/widgets.php
r14382 r14404 559 559 560 560 add_theme_support('widgets'); 561 561 562 562 do_action( 'register_sidebar', $sidebar ); 563 563 564 564 return $sidebar['id']; 565 565 } … … 691 691 function wp_unregister_sidebar_widget($id) { 692 692 do_action( 'wp_unregister_sidebar_widget', $id ); 693 693 694 694 wp_register_sidebar_widget($id, '', ''); 695 695 wp_unregister_widget_control($id); … … 885 885 886 886 $callback = $wp_registered_widgets[$id]['callback']; 887 887 888 888 do_action( 'dynamic_sidebar', $wp_registered_widgets[$id] ); 889 889
Note: See TracChangeset
for help on using the changeset viewer.