Changeset 13733
- Timestamp:
- 03/17/2010 04:27:25 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 43 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r13559 r13733 36 36 addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}}; 37 37 var userSettings = { 38 'url': '<?php echo SITECOOKIEPATH; ?>', 38 'url': '<?php echo SITECOOKIEPATH; ?>', 39 39 'uid': '<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>', 40 40 'time':'<?php echo time() ?>' 41 41 }, 42 ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', 43 pagenow = '<?php echo $current_screen->id; ?>', 44 typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>', 45 adminpage = '<?php echo $admin_body_class; ?>', 46 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>', 42 ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', 43 pagenow = '<?php echo $current_screen->id; ?>', 44 typenow = '<?php if ( isset($current_screen->post_type) ) echo $current_screen->post_type; ?>', 45 adminpage = '<?php echo $admin_body_class; ?>', 46 thousandsSeparator = '<?php echo addslashes( $wp_locale->number_format['thousands_sep'] ); ?>', 47 47 decimalPoint = '<?php echo addslashes( $wp_locale->number_format['decimal_point'] ); ?>'; 48 48 //]]> -
trunk/wp-admin/css/install.dev.css
r13696 r13733 54 54 border-bottom: none; 55 55 text-align:center 56 } 56 } 57 57 58 58 .step { -
trunk/wp-admin/edit-tags.php
r13693 r13733 306 306 <?php elseif ( 'post_tag' == $taxonomy ) : ?> 307 307 <div class="form-wrap"> 308 <p><?php printf(__('Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>'), 'admin.php?import=wp-cat2tag&step=3') ;?>.</p> 308 <p><?php printf(__('Tags can be selectively converted to categories using the <a href="%s">tag to category converter</a>'), 'admin.php?import=wp-cat2tag&step=3') ;?>.</p> 309 309 </div> 310 310 <?php endif; -
trunk/wp-admin/export.php
r13573 r13733 50 50 $months = ""; 51 51 for ( $i = 1; $i < 13; $i++ ) { 52 $months .= "\t\t\t<option value=\"" . zeroise($i, 2) . '">' . 52 $months .= "\t\t\t<option value=\"" . zeroise($i, 2) . '">' . 53 53 $wp_locale->get_month_abbrev( $wp_locale->get_month( $i ) ) . "</option>\n"; 54 54 } ?> -
trunk/wp-admin/includes/class-wp-upgrader.php
r13686 r13733 1087 1087 if ( is_string($error) && isset( $this->upgrader->strings[$error] ) ) 1088 1088 $this->error = $this->upgrader->strings[$error]; 1089 1089 1090 1090 if ( is_wp_error($error) && $error->get_error_code() ) { 1091 1091 foreach ( $error->get_error_messages() as $emessage ) { -
trunk/wp-admin/includes/export.php
r13573 r13733 39 39 header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); 40 40 41 if ( $post_type and $post_type != 'all' ) { 42 $where = $wpdb->prepare("WHERE post_type = %s ", $post_type); 43 } else { 44 $where = "WHERE post_type != 'revision' "; 45 } 46 if ( $author and $author != 'all' ) { 47 $author_id = (int) $author; 48 $where .= $wpdb->prepare("AND post_author = %d ", $author_id); 49 } 50 if ( $start_date and $start_date != 'all' ) { 51 $where .= $wpdb->prepare("AND post_date >= %s ", $start_date); 52 } 53 if ( $end_date and $end_date != 'all' ) { 54 $where .= $wpdb->prepare("AND post_date < %s ", $end_date); 55 } 56 if ( $category and $category != 'all' ) { 57 $taxomony_id = (int) $category; 58 $where .= $wpdb->prepare("AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} " . "WHERE term_taxonomy_id = %d) ", $taxomony_id); 59 } 60 if ( $status and $status != 'all' ) { 61 $where .= $wpdb->prepare("AND post_status = %s ", $status); 62 } 41 if ( $post_type and $post_type != 'all' ) { 42 $where = $wpdb->prepare("WHERE post_type = %s ", $post_type); 43 } else { 44 $where = "WHERE post_type != 'revision' "; 45 } 46 if ( $author and $author != 'all' ) { 47 $author_id = (int) $author; 48 $where .= $wpdb->prepare("AND post_author = %d ", $author_id); 49 } 50 if ( $start_date and $start_date != 'all' ) { 51 $where .= $wpdb->prepare("AND post_date >= %s ", $start_date); 52 } 53 if ( $end_date and $end_date != 'all' ) { 54 $where .= $wpdb->prepare("AND post_date < %s ", $end_date); 55 } 56 if ( $category and $category != 'all' ) { 57 $taxomony_id = (int) $category; 58 $where .= $wpdb->prepare("AND ID IN (SELECT object_id FROM {$wpdb->term_relationships} " . "WHERE term_taxonomy_id = %d) ", $taxomony_id); 59 } 60 if ( $status and $status != 'all' ) { 61 $where .= $wpdb->prepare("AND post_status = %s ", $status); 62 } 63 63 64 64 // grab a snapshot of post IDs, just in case it changes during the export -
trunk/wp-admin/includes/file.php
r13662 r13733 314 314 // A writable uploads dir will pass this test. Again, there's no point overriding this one. 315 315 if ( ! ( ( $uploads = wp_upload_dir($time) ) && false === $uploads['error'] ) ) 316 return call_user_func($upload_error_handler, $file, $uploads['error'] ); 316 return call_user_func($upload_error_handler, $file, $uploads['error'] ); 317 317 318 318 $filename = wp_unique_filename( $uploads['path'], $file['name'], $unique_filename_callback ); -
trunk/wp-admin/includes/misc.php
r13609 r13733 657 657 /** 658 658 * Send a HTTP header to disable content type sniffing in browsers which support it. 659 * 659 * 660 660 * @link http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx 661 661 * @link http://src.chromium.org/viewvc/chrome?view=rev&revision=6985 662 * 662 * 663 663 * @since 3.0.0. 664 664 * @return none 665 665 */ 666 666 function send_nosniff_header() { 667 @header( 'X-Content-Type-Options: nosniff' ); 667 @header( 'X-Content-Type-Options: nosniff' ); 668 668 } 669 669 /** -
trunk/wp-admin/includes/ms.php
r13715 r13733 169 169 if ( !is_array( $users ) ) 170 170 return false; 171 171 172 172 screen_icon('tools'); 173 173 ?> … … 184 184 if ( $val != '' && $val != '0' ) { 185 185 $delete_user = new WP_User( $val ); 186 186 187 187 if ( in_array( $delete_user->user_login, $site_admins ) ) 188 188 wp_die( sprintf( __( 'Warning! User cannot be deleted. The user %s is a network admnistrator.' ), $delete_user->user_login ) ); 189 189 190 190 echo "<input type='hidden' name='user[]' value='{$val}'/>\n"; 191 191 $blogs = get_blogs_of_user( $val, true ); 192 192 193 193 if ( !empty( $blogs ) ) { 194 194 echo '<p><strong>' . sprintf( __( 'Sites from %s:' ), $delete_user->user_login ) . '</strong></p>'; -
trunk/wp-admin/includes/nav-menu.php
r13727 r13733 14 14 function wp_nav_menu_post_type_metaboxes() { 15 15 $post_types = get_post_types( array( 'public' => true ), 'object' ); 16 16 17 17 if ( !$post_types ) 18 18 return false; … … 100 100 function wp_nav_menu_item_link_metabox() { 101 101 $args = array( 'post_status' => 'any', 'post_type' => 'nav_menu_item', 'meta_value' => 'custom', 'showposts' => -1 ); 102 102 103 103 // @todo transient caching of these results with proper invalidation on updating links 104 104 $query = new WP_Query( $args ); 105 105 106 106 ?> 107 107 <p id="menu-item-url-wrap"> … … 118 118 </label> 119 119 </p> 120 120 121 121 <p class="button-controls"> 122 122 <a class="show-all"><?php _e('View All'); ?></a> … … 147 147 function wp_nav_menu_item_post_type_metabox( $object, $post_type ) { 148 148 $args = array( 'post_type' => $post_type['args']->name, 'post_status' => 'publish', 'showposts' => -1 ); 149 149 150 150 if ( 'attachment' == $post_type['args']->name ) 151 151 $args['post_status'] = 'any'; 152 152 153 153 // @todo transient caching of these results with proper invalidation on updating of a post of this type 154 154 $query = new WP_Query( $args ); 155 155 156 156 if ( !$query->posts ) 157 157 $error = '<li id="error">'. sprintf( __( 'No %s exists' ), $post_type['args']->label ) .'</li>'; 158 158 159 159 $pt_names = ''; 160 160 if ( is_array($query->posts) ) { … … 167 167 } 168 168 } 169 169 170 170 $id = $post_type['args']->name; 171 171 ?> … … 174 174 <a class="quick-search-submit button-secondary"><?php _e('Search'); ?></a> 175 175 </p> 176 176 177 177 <p class="button-controls"> 178 178 <a class="show-all"><?php _e('View All'); ?></a> 179 179 <a class="hide-all"><?php _e('Hide All'); ?></a> 180 180 </p> 181 181 182 182 <div id="existing-<?php echo esc_attr( $id ); ?>" class="list-wrap"> 183 183 <div class="list-container"> … … 219 219 // @todo transient caching of these results with proper invalidation on updating of a tax of this type 220 220 $terms = get_terms( $taxonomy['args']->name, $args ); 221 221 222 222 if ( !$terms ) 223 223 $error = '<li id="error">'. sprintf( __( 'No %s exists' ), $taxonomy['args']->label ) .'</li>'; 224 224 225 225 $term_names = ''; 226 226 if ( is_array($terms) ) { … … 233 233 } 234 234 } 235 235 236 236 $id = $taxonomy['args']->name; 237 237 ?> … … 240 240 <a class="quick-search-submit button-secondary"><?php _e('Search'); ?></a> 241 241 </p> 242 242 243 243 <p class="button-controls"> 244 244 <a class="show-all"><?php _e('View All'); ?></a> 245 245 <a class="hide-all"><?php _e('Hide All'); ?></a> 246 246 </p> 247 247 248 248 <div id="existing-<?php echo esc_attr( $id ); ?>" class="list-wrap"> 249 249 <div class="list-container"> … … 282 282 if ( !$menu_items ) 283 283 return __( 'Not Found' ); 284 284 285 285 $output = ''; 286 286 $i = 1; … … 290 290 if ( !isset($menu_item->post_parent) ) 291 291 $menu_item->post_parent = $menu_item->parent; 292 292 293 293 // Cleanest way to get all attachements 294 294 if ( 'attachment' == $object ) 295 295 $menu_item->post_parent = 0; 296 296 297 297 if ( 0 == $menu_item->post_parent ) { 298 298 // Set up the menu item 299 $menu_item = wp_setup_nav_menu_item( $menu_item, $object_type, $object ); 299 $menu_item = wp_setup_nav_menu_item( $menu_item, $object_type, $object ); 300 300 $attributes = ( 'backend' == $context ) ? ' id="menu-item-'. $i .'" value="'. $i .'"' : ''; 301 301 302 302 $output .= '<li'. $attributes .'>'; 303 303 $output .= wp_get_nav_menu_item( $menu_item, $object_type, $object ); … … 308 308 } 309 309 } 310 310 311 311 return $output; 312 312 } … … 324 324 function wp_get_nav_menu_sub_items( $childof, $object_type, $object = null, $context = 'frontend' ) { 325 325 $args = array( 'child_of' => $childof, 'parent' => $childof, 'hide_empty' => false, ); 326 326 327 327 switch ( $object_type ) { 328 328 case 'post_type': … … 335 335 } 336 336 break; 337 337 338 338 case 'taxonomy': 339 339 if ( is_taxonomy_hierarchical( $object ) ) { … … 343 343 } 344 344 break; 345 345 346 346 default: 347 347 $sub_menu_items = array(); 348 348 break; 349 349 } 350 350 351 351 $output = ''; 352 352 $i = 1; -
trunk/wp-admin/includes/plugin.php
r13579 r13733 558 558 * @param string|array $plugins 559 559 * @param string $redirect Redirect to page after successful activation. 560 * @param bool $network_wide Whether to enable the plugin for all sites in the network. 560 * @param bool $network_wide Whether to enable the plugin for all sites in the network. 561 561 * @return bool|WP_Error True when finished or WP_Error if there were errors during a plugin activation. 562 562 */ -
trunk/wp-admin/includes/post.php
r13729 r13733 271 271 unset($post_data['post_category']); 272 272 } 273 273 274 274 $tax_input = array(); 275 275 if ( isset($post_data['tax_input'])) { … … 279 279 $taxonomy = get_taxonomy( $tax_name ); 280 280 if ( $taxonomy->hierarchical ) 281 $tax_input[$tax_name] = array_map( 'absint', $terms ); 281 $tax_input[$tax_name] = array_map( 'absint', $terms ); 282 282 else { 283 283 $tax_input[$tax_name] = preg_replace( '/\s*,\s*/', ',', rtrim( trim($terms), ' ,' ) ); … … 315 315 continue; 316 316 } 317 317 318 318 $tax_names = get_object_taxonomies( get_post($post_ID) ); 319 319 320 320 if ( isset($new_cats) && in_array( 'category', $tax_names ) ) { 321 321 $cats = (array) wp_get_post_categories($post_ID); 322 322 $post_data['post_category'] = array_unique( array_merge($cats, $new_cats) ); 323 323 } 324 324 325 325 foreach ( $tax_names as $tax_name ) { 326 326 if( isset( $tax_input[$tax_name]) ) { -
trunk/wp-admin/includes/template.php
r13661 r13733 863 863 foreach ( $taxonomy_names as $taxonomy_name ) { 864 864 $taxonomy = get_taxonomy( $taxonomy_name); 865 865 866 866 if( !$taxonomy->show_ui ) continue; 867 867 868 868 if( $taxonomy->hierarchical ) 869 869 $hierarchical_taxonomies[] = $taxonomy; 870 else 870 else 871 871 $flat_taxonomies[] = $taxonomy; 872 872 } 873 873 874 874 $columns = wp_manage_posts_columns($screen); 875 875 $hidden = array_intersect( array_keys( $columns ), array_filter( get_hidden_columns($screen) ) ); … … 966 966 967 967 <fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col"> 968 968 969 969 <?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?> 970 970 … … 2974 2974 2975 2975 * @param string $id Slug-name to identify the section. Used in the 'id' attribute of tags. 2976 * @param string $title Formatted title of the section. Shown as the heading for the section. 2976 * @param string $title Formatted title of the section. Shown as the heading for the section. 2977 2977 * @param string $callback Function that echo's out content for the section heading. 2978 2978 * @param string $page The slug-name of the settings page on which to show the section (general, reading, writing, ...). … … 3000 3000 * The $callback argument should be the name of a function that echoes out the 3001 3001 * html input tags for this setting field. Use get_option() to retrive existing 3002 * values to show. 3002 * values to show. 3003 3003 * 3004 3004 * @since 2.7.0 … … 3103 3103 * 3104 3104 * @global array $wp_settings_errors Storage array of errors registered during this pageload 3105 * 3105 * 3106 3106 * @param string $setting Slug title of the setting to which this error applies 3107 3107 * @param string $code Slug-name to identify the error. Used as part of 'id' attribute in HTML output. … … 3130 3130 * pageload and returns them. 3131 3131 * 3132 * If changes were just submitted ($_GET['updated']) and settings errors were saved 3132 * If changes were just submitted ($_GET['updated']) and settings errors were saved 3133 3133 * to the 'settings_errors' transient then those errors will be returned instead. This 3134 3134 * is used to pass errors back across pageloads. … … 3178 3178 * 3179 3179 * Part of the Settings API. Outputs a <div> for each error retrieved by get_settings_errors(). 3180 * 3180 * 3181 3181 * This is called automatically after a settings page based on the Settings API is submitted. 3182 3182 * Errors should be added during the validation callback function for a setting defined in register_setting() … … 3301 3301 function favorite_actions( $screen = null ) { 3302 3302 global $post_type_object; 3303 3303 3304 3304 $default_action = false; 3305 3305 3306 3306 if ( is_string($screen) ) 3307 3307 $screen = convert_to_screen($screen); 3308 3308 3309 3309 if ( isset($post_type_object) ) { 3310 3310 switch ( $screen->id ) { … … 3317 3317 } 3318 3318 } 3319 3319 3320 3320 if ( !$default_action ) { 3321 3321 switch ( $screen->id ) { -
trunk/wp-admin/includes/upgrade.php
r13715 r13733 266 266 )); 267 267 268 // Setup default widgets for default theme. 269 update_option( 'widget_search', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) ); 268 // Setup default widgets for default theme. 269 update_option( 'widget_search', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) ); 270 270 update_option( 'widget_recent-posts', array ( 2 => array ( 'title' => '', 'number' => 5 ), '_multiwidget' => 1 ) ); 271 271 update_option( 'widget_recent-comments', array ( 2 => array ( 'title' => '', 'number' => 5 ), '_multiwidget' => 1 ) ); … … 1110 1110 if ( $wp_current_db_version < 12751 ) { 1111 1111 populate_roles_300(); 1112 if ( is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false ) 1112 if ( is_multisite() && is_main_site() && ! defined( 'MULTISITE' ) && get_site_option( 'siteurl' ) === false ) 1113 1113 add_site_option( 'siteurl', '' ); 1114 1114 } -
trunk/wp-admin/js/common.dev.js
r13548 r13733 290 290 this.scrollTop = scroll; 291 291 } 292 292 293 293 if ( e.stopPropagation ) 294 294 e.stopPropagation(); … … 296 296 e.preventDefault(); 297 297 }); 298 298 299 299 $('#newcontent').blur(function(e) { 300 300 if ( this.lastKey && 9 == this.lastKey ) -
trunk/wp-admin/js/inline-edit-post.dev.js
r13535 r13733 159 159 } 160 160 }); 161 161 162 162 163 163 // handle the post status -
trunk/wp-admin/js/nav-menu.dev.js
r13730 r13733 34 34 var item_classes = jQuery('#menu-item-classes' + id).val(); 35 35 var item_xfn = jQuery('#menu-item-xfn' + id).val(); 36 36 37 37 // Only allow custom links to be editable. 38 38 if ( 'custom' != item_type ) 39 39 jQuery( '#edit-menu-item-url' ).attr('disabled', 'disabled' ); 40 40 41 41 // Populate the fields for thickbox 42 42 jQuery( '#edit-menu-item-id' ).val(id); … … 49 49 jQuery( '#edit-menu-item-classes' ).val(item_classes); 50 50 jQuery( '#edit-menu-item-xfn' ).val(item_xfn); 51 51 52 52 // focus 53 53 jQuery( '#edit-menu-item-title' ).focus(); … … 66 66 var item_classes = jQuery('#edit-menu-item-classes').val(); 67 67 var item_xfn = jQuery('#edit-menu-item-xfn').val(); 68 68 69 69 // update menu item settings 70 70 jQuery('.menu #menu-item' + id).find('span.item-title').html(item_title); … … 76 76 jQuery('.menu #menu-item-classes' + id).val(item_classes); 77 77 jQuery('.menu #menu-item-xfn' + id).val(item_xfn); 78 78 79 79 jQuery('.menu #menu-item' + id + ' dt:first').animate( { backgroundColor: '#FFFF33' }, { duration: 'normal', complete: function() { jQuery(this).css( 'backgroundColor', '' ); }}); 80 80 } … … 87 87 function wp_remove_menu_item( o ) { 88 88 var todelete = document.getElementById('menu-item' + o); 89 89 90 90 if ( todelete ) { 91 91 // Give some feedback to the user … … 115 115 var randomnumber = wp_get_unique_menu_id(); 116 116 var hidden = wp_get_hidden_inputs( randomnumber, item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn ); 117 117 118 118 // Adds the item in the queue 119 119 jQuery('.menu').append('<li id="menu-item' + randomnumber + '" value="' + randomnumber + '"><div class="dropzone ui-droppable"></div><dl class="ui-droppable"><dt><span class="item-title">' + item_title + '</span><span class="item-controls"><span class="item-type">' + item_append + '</span><a class="item-edit thickbox" id="edit' + randomnumber + '" value="' + randomnumber +'" onClick="wp_edit_menu_item('+ randomnumber +')" title="' + navMenuL10n.thickbox + '" href="#TB_inline?height=540&width=300&inlineId=menu-item-settings">' + navMenuL10n.edit + '</a> | <a class="item-delete" id="delete' + randomnumber + '" value="' + randomnumber +'">Delete</a></span></dt></dl>' + hidden + '</li>'); 120 120 121 121 // Give some feedback to the user 122 122 jQuery( '.menu #menu-item' + randomnumber + ' dt:first' ).animate( { backgroundColor: '#FFFF33' }, { duration: 'normal', complete: function() { jQuery(this).css( 'backgroundColor', '' ); }}); 123 123 124 124 // Enable drag-n-drop 125 125 wp_drag_and_drop(); 126 126 127 127 // Reload thickbox 128 128 tb_init('a.thickbox, area.thickbox, input.thickbox'); … … 137 137 // Grab checked items 138 138 var items = jQuery(button).siblings('.list-wrap').find(':checked'); 139 139 140 140 // If nothing was checked, cancel 141 141 if ( 0 == items.length ) 142 142 return false; 143 143 144 144 // Loop through each item, grab it's hidden data and add it to the menu. 145 145 jQuery(items).each(function(){ 146 146 var item_type = jQuery(this).parent().siblings('.menu-item-type').val(); 147 147 148 148 if ( 'custom' == item_type ) { 149 149 var item_attr_title = jQuery(this).parent().siblings('.menu-item-attr-title').val(); … … 157 157 var item_xfn = ''; 158 158 }; 159 159 160 160 var item_db_id = jQuery(this).parent().siblings('.menu-item-db-id').val(); 161 161 var item_object_id = jQuery(this).parent().siblings('.menu-item-object-id').val(); … … 165 165 var item_url = jQuery(this).parent().siblings('.menu-item-url').val(); 166 166 var item_description = jQuery(this).parent().siblings('.menu-item-description').val(); 167 167 168 168 if ( undefined == item_description ) { 169 169 item_description = ''; 170 170 }; 171 171 172 172 // Add the menu item to the menu 173 173 wp_add_item_to_menu( item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn ); 174 174 175 175 // uncheck the menu item in the list 176 176 jQuery(this).attr( 'checked', false ); … … 205 205 var li = jQuery(this).parent(); 206 206 var child = !jQuery(this).hasClass('dropzone'); 207 207 208 208 // Append UL to first child 209 209 if ( child && li.children('ul').length == 0 ) { … … 221 221 var draggablevalue = ui.draggable.attr('value'); 222 222 var droppablevalue = li.attr('value'); 223 223 224 224 li.find('#menu-' + draggablevalue).find('#parent' + draggablevalue).val(droppablevalue); 225 225 jQuery(this).parent().find('dt').removeAttr('style'); … … 255 255 function wp_update_post_data() { 256 256 var i = 0; 257 257 258 258 jQuery('.menu li').each(function(i) { 259 259 i = i + 1; … … 263 263 jQuery(this).attr('id','menu-item' + i); 264 264 jQuery(this).attr('value', i); 265 265 266 266 jQuery(this).find('#menu-item-db-id' + j).attr('id','menu-item-db-id' + i); 267 267 jQuery(this).find('#menu-item-object-id' + j).attr('id','menu-item-object-id' + i); … … 279 279 } 280 280 jQuery(this).find('#menu-item-parent-id' + j).attr('value', p); 281 281 282 282 jQuery(this).find('#menu-item-title' + j).attr('id','menu-item-title' + i); 283 283 jQuery(this).find('#menu-item-url' + j).attr('id','menu-item-url' + i); … … 288 288 jQuery(this).find('#menu-item-attr-title' + j).attr('id','menu-item-attr-title' + i); 289 289 jQuery(this).find('#menu-item-target' + j).attr('id','menu-item-target' + i); 290 290 291 291 jQuery('#li-count').attr( 'value', i ); 292 292 }); … … 322 322 /** 323 323 * Returns all the nessecary hidden inputs for each menu item. 324 * 324 * 325 325 * @param string item_db_id - The menu item's db id. 326 326 * @param string item_object_id - The menu item's object id. … … 338 338 function wp_get_hidden_inputs( randomnumber, item_db_id, item_object_id, item_type, item_append, item_parent_id, item_title, item_url, item_description, item_attr_title, item_target, item_classes, item_xfn ) { 339 339 var hidden = ''; 340 340 341 341 hidden += '<input type="hidden" name="menu-item-db-id[]" id="menu-item-db-id' + randomnumber + '" value="' + item_db_id + '" />'; 342 342 hidden += '<input type="hidden" name="menu-item-object-id[]" id="menu-item-object-id' + randomnumber + '" value="' + item_object_id + '" />'; … … 352 352 hidden += '<input type="hidden" name="menu-item-classes[]" id="menu-item-classes' + randomnumber + '" value="' + item_classes + '" />'; 353 353 hidden += '<input type="hidden" name="menu-item-xfn[]" id="menu-item-xfn' + randomnumber + '" value="' + item_xfn + '" />'; 354 354 355 355 return hidden; 356 356 } … … 370 370 */ 371 371 jQuery(document).ready(function($){ 372 372 373 373 wp_drag_and_drop(); 374 374 375 375 // Delete AYS 376 376 $('#update-nav-menu .deletion').click(function(){ … … 381 381 }; 382 382 }); 383 383 384 384 // Handle Save Button Clicks 385 385 $('#save_menu').click(function(){ 386 386 return wp_update_post_data(); 387 387 }); 388 388 389 389 // close postboxes that should be closed 390 390 $('.if-js-closed').removeClass('if-js-closed').addClass('closed'); 391 391 392 392 // postboxes setup 393 393 postboxes.add_postbox_toggles('menus'); 394 394 395 395 // Clear the quick search textbox 396 396 $('.quick-search').click(function(){ 397 397 $(this).attr( 'value', '' ); 398 398 }); 399 399 400 400 // Quick Search submit 401 401 $('.quick-search-submit').click(function(){ 402 402 $(this).siblings('.quick-search').search(); 403 403 }); 404 404 405 405 // Edit menu item 406 406 $('#menu-container .item-edit').click(function(){ 407 407 return wp_edit_menu_item( $(this).attr('value') ); 408 408 }); 409 409 410 410 // Delete menu item 411 411 $('#menu-container .item-delete').live( 'click', function(e){ 412 412 return wp_remove_menu_item( $(this).attr('value') ); 413 413 }); 414 414 415 415 // Update menu item settings (thickbox) 416 416 $('#update-menu-item').click(function(){ … … 418 418 return tb_remove(); 419 419 }); 420 420 421 421 // Close thickbox 422 422 $('#cancel-save').click(function(){ 423 423 return tb_remove(); 424 424 }); 425 425 426 426 // Show All Button 427 427 $('.show-all').click(function(e){ … … 431 431 jQuery(e.currentTarget).siblings('.hide-all').show(); 432 432 }); 433 433 434 434 // Hide All Button 435 435 $('.hide-all').click(function(e){ … … 449 449 var link_url = jQuery(e.currentTarget).parent().parent().find('#custom-menu-item-url').val(); 450 450 var link_name = jQuery(e.currentTarget).parent().parent().find('#custom-menu-item-name').val(); 451 451 452 452 // Add link to menu 453 453 wp_add_item_to_menu( 0, '', 'custom', navMenuL10n.custom, 0, link_name, link_url, '', '', '_self', '', '' ); -
trunk/wp-admin/menu.php
r13679 r13733 49 49 if ( is_multisite() ) 50 50 $submenu[ 'index.php' ][5] = array( __('My Sites'), 'read', 'my-sites.php' ); 51 51 52 52 if ( is_super_admin() ) { 53 53 $plugin_update_count = $theme_update_count = $wordpress_update_count = 0; … … 117 117 $_wp_last_object_menu++; 118 118 $ptype_obj = get_post_type_object($ptype); 119 119 120 120 $menu[$_wp_last_object_menu] = array(esc_attr($ptype_obj->label), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-posts', 'menu-' . sanitize_html_class($ptype), 'div'); 121 121 $submenu["edit.php?post_type=$ptype"][5] = array( __('Edit'), 'edit_posts', "edit.php?post_type=$ptype"); -
trunk/wp-admin/ms-edit.php
r13715 r13733 306 306 if ( $id != '0' && $id != $current_site->blog_id ) 307 307 wpmu_delete_blog( $id, true ); 308 308 309 309 wp_redirect( add_query_arg( array('updated' => 'true', 'action' => 'delete'), $_POST[ 'ref' ] ) ); 310 310 exit(); … … 343 343 wp_die( __('You are not allowed to change one of these sites.') ); 344 344 exit(); 345 }; 346 }; 345 }; 346 }; 347 347 348 348 wp_redirect( add_query_arg( array('updated' => 'true', 'action' => $blogfunction), $_SERVER['HTTP_REFERER'] ) ); -
trunk/wp-admin/ms-sites.php
r13665 r13733 244 244 foreach ( (array) $blogusers as $key => $val ) { 245 245 if ( isset( $val->meta_value ) && ! $val->meta_value ) 246 continue; 246 continue; 247 247 $t = @unserialize( $val->meta_value ); 248 248 if ( is_array( $t ) ) { … … 338 338 339 339 $s = isset($_GET['s']) ? stripslashes( trim( $_GET[ 's' ] ) ) : ''; 340 $like_s = esc_sql( like_escape( $s ) ); 340 $like_s = esc_sql( like_escape( $s ) ); 341 341 342 342 $query = "SELECT * FROM {$wpdb->blogs} WHERE site_id = '{$wpdb->siteid}' "; … … 420 420 $status_class = ''; 421 421 $count = get_blog_count(); 422 422 423 423 if ( empty($_GET['blogstatus']) || $_GET['blogstatus'] == 'all' ) 424 424 $status_class = ' class="current"'; … … 475 475 number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ), 476 476 number_format_i18n( min( $pagenum * $per_page, $num_pages ) ), 477 number_format_i18n( $num_pages ), 477 number_format_i18n( $num_pages ), 478 478 $page_links 479 479 ); echo $page_links_text; ?> 480 480 </div> 481 481 <?php } ?> 482 482 483 483 <div class="view-switch"> 484 484 <a href="<?php echo esc_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" width="20" height="20" title="<?php _e('List View') ?>" alt="<?php _e('List View') ?>" /></a> … … 488 488 </div> 489 489 490 <div class="clear"></div> 490 <div class="clear"></div> 491 491 492 492 <?php … … 540 540 if ( $order_by == $column_id ) 541 541 $order2 = ($order == 'DESC') ? 'ASC' : 'DESC'; 542 542 543 543 $column_link .= esc_url(add_query_arg( array('order' => $order2, 'paged' => $pagenum, 'sortby' => $column_id ), remove_query_arg( array('action', 'updated'), $_SERVER['REQUEST_URI'] ) ) ); 544 544 $column_link .= "'>{$column_display_name}</a>"; … … 547 547 <th scope="col"> 548 548 <?php echo $col_url ?> 549 </th> 549 </th> 550 550 <?php } ?> 551 551 </tr> … … 640 640 $date = 'Y/m/d \<\b\r \/\> g:i:s a'; 641 641 echo ( $blog['last_updated'] == '0000-00-00 00:00:00' ) ? __("Never") : mysql2date( __( $date ), $blog['last_updated'] ); ?> 642 </td> 642 </td> 643 643 <?php 644 644 break; -
trunk/wp-admin/ms-users.php
r13443 r13733 196 196 <td class="username column-username"> 197 197 <?php echo $avatar; ?><strong><a href="<?php echo $edit; ?>" class="edit"><?php echo stripslashes($user['user_login']); ?></a><?php 198 if ( in_array( $user[ 'user_login' ], $super_admins ) ) 198 if ( in_array( $user[ 'user_login' ], $super_admins ) ) 199 199 echo ' - ' . __( 'Super admin' ); 200 200 ?></strong> -
trunk/wp-admin/nav-menus.php
r13732 r13733 63 63 } 64 64 break; 65 65 66 66 case 'update': 67 67 check_admin_referer( 'update-nav_menu' ); 68 68 69 69 // Add Menu 70 70 if ( isset($_POST['create-menu']) ) { … … 92 92 $new_nav_menu = wp_update_term( $nav_menu_selected_id, 'nav_menu', $args ); 93 93 } 94 94 95 95 // Update menu items 96 96 $update_nav_items = isset( $_POST['li-count'] ) ? (int) $_POST['li-count'] : 0; 97 97 $update_nav_menu = is_nav_menu( $nav_menu_selected_id ); 98 98 99 99 if ( !is_wp_error($update_nav_menu) ) { 100 100 $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID') ); 101 101 $parent_menu_ids = array(); 102 102 103 103 // Loop through all POST variables 104 104 for ( $k = 0; $k < $update_nav_items; $k++ ) { … … 109 109 $menu_item_type = isset( $_POST['menu-item-type'][$k] ) ? $_POST['menu-item-type'][$k] : 'custom'; 110 110 $menu_item_append = isset( $_POST['menu-item-append'][$k] ) ? $_POST['menu-item-append'][$k] : 'custom'; 111 111 112 112 $menu_item_title = isset( $_POST['menu-item-title'][$k] ) ? $_POST['menu-item-title'][$k] : ''; 113 113 $menu_item_url = isset( $_POST['menu-item-url'][$k] ) ? $_POST['menu-item-url'][$k] : ''; … … 117 117 $menu_item_classes = isset( $_POST['menu-item-classes'][$k] ) ? $_POST['menu-item-classes'][$k] : ''; 118 118 $menu_item_xfn = isset( $_POST['menu-item-xfn'][$k] ) ? $_POST['menu-item-xfn'][$k] : ''; 119 119 120 120 // Menu item title can't be blank 121 121 if ( '' == $menu_item_title ) 122 122 continue; 123 123 124 124 // Populate the menu item 125 125 $post = array( 'post_status' => 'publish', 'post_type' => 'nav_menu_item', 'post_author' => $user_ID, … … 137 137 } 138 138 $parent_menu_ids[$k] = $menu_item_db_id; 139 139 140 140 // @todo sanitize type append and ID. 141 141 update_post_meta( $menu_item_db_id, 'menu_item_type', $menu_item_type ); … … 146 146 update_post_meta( $menu_item_db_id, 'menu_item_classes', sanitize_html_class($menu_item_classes) ); 147 147 update_post_meta( $menu_item_db_id, 'menu_item_xfn', sanitize_html_class($menu_item_xfn) ); 148 148 149 149 // @todo: only save custom link urls. 150 150 update_post_meta( $menu_item_db_id, 'menu_item_url', esc_url_raw( $menu_item_url ) ); 151 151 } 152 152 153 153 // Remove menu items from the menu that weren't in $_POST 154 154 if ( !empty( $menu_items ) ) { … … 178 178 // Else try to grab the first menu from the menus list 179 179 } elseif ( 0 == $nav_menu_selected_id && ! empty($nav_menus) ) { 180 $nav_menu_selected_id = $nav_menus[0]->term_id; 180 $nav_menu_selected_id = $nav_menus[0]->term_id; 181 181 } 182 182 … … 215 215 foreach ( $nav_menus as $_nav_menu ) { 216 216 $sep = end( $nav_menus ) == $_nav_menu ? '' : ' | '; 217 217 218 218 if ( $nav_menu_selected_id == $_nav_menu->term_id ) 219 219 echo '<li><a href="'. admin_url( 'nav-menus.php?action=edit&menu=' . esc_attr($_nav_menu->term_id) ) .'" class="current">'. esc_html( $_nav_menu->name ) .'</a>'. $sep .'</li>'; … … 233 233 <input type="hidden" name="li-count" id="li-count" value="0" /> 234 234 <input type="hidden" name="menu" id="menu" value="<?php echo esc_attr( $nav_menu_selected_id ); ?>" /> 235 235 236 236 <div id="post-body"> 237 237 <div id="post-body-content"> … … 240 240 <h3 class="hndle"><?php echo esc_html( $nav_menu_selected_title ); ?></h3> 241 241 <div class="inside"> 242 242 243 243 <?php echo wp_get_nav_menu( array( 'context' => 'backend', 'menu' => $nav_menu_selected_id ) ); ?> 244 244 245 245 </div><!-- /.inside --> 246 246 <!-- /#nav-menu-canvas .postbox--> … … 253 253 </div><!--- /#post-body --> 254 254 <div id="menu-settings-column" class="inner-sidebar"> 255 255 256 256 <?php do_meta_boxes( 'menus', 'side', null ); ?> 257 257 258 258 </div><!-- /#menu-settings-column --> 259 259 </form><!--/#update-nav-menu--> -
trunk/wp-admin/network.php
r13679 r13733 279 279 } 280 280 ?></textarea> 281 <?php 281 <?php 282 282 } 283 283 ?> -
trunk/wp-admin/options.php
r13721 r13733 30 30 if ( !current_user_can('manage_options') ) 31 31 wp_die(__('Cheatin’ uh?')); 32 32 33 33 if ( is_multisite() && !is_super_admin() && 'update' != $action ) 34 34 wp_die(__('Cheatin’ uh?')); -
trunk/wp-admin/plugins.php
r13602 r13733 97 97 break; 98 98 case 'update-selected' : 99 99 100 100 check_admin_referer( 'bulk-manage-plugins' ); 101 101 102 102 if ( isset( $_GET['plugins'] ) ) 103 103 $plugins = explode( ',', $_GET['plugins'] ); … … 106 106 else 107 107 $plugins = array(); 108 108 109 109 $title = __( 'Upgrade Plugins' ); 110 110 $parent_file = 'plugins.php'; 111 111 112 112 require_once( 'admin-header.php' ); 113 113 114 114 echo '<div class="wrap">'; 115 115 screen_icon(); -
trunk/wp-admin/tools.php
r13524 r13733 91 91 $tags = get_taxonomy('post_tag'); 92 92 93 if ( current_user_can($cats->manage_cap) || current_user_can($tags->manage_cap) ) : ?> 94 <div class="tool-box"> 93 if ( current_user_can($cats->manage_cap) || current_user_can($tags->manage_cap) ) : ?> 94 <div class="tool-box"> 95 95 <h3 class="title"><?php _e('Category/Tag Conversion') ?></h3> 96 <p><?php printf(__('Use this to convert <a href="%s">categories to tags</a>, or <a href="%s">tags to categories</a>.'), 'admin.php?import=wp-cat2tag', 'admin.php?import=wp-cat2tag&step=3'); ?></p> 97 </div> 96 <p><?php printf(__('Use this to convert <a href="%s">categories to tags</a>, or <a href="%s">tags to categories</a>.'), 'admin.php?import=wp-cat2tag', 'admin.php?import=wp-cat2tag&step=3'); ?></p> 97 </div> 98 98 <?php 99 endif; 99 endif; 100 100 101 101 do_action( 'tool_box' ); -
trunk/wp-admin/update-core.php
r13728 r13733 268 268 foreach ( (array) $themes as $stylesheet => $theme_data) { 269 269 $screenshot = $theme_data->{'Theme Root URI'} . '/' . $stylesheet . '/' . $theme_data->Screenshot; 270 270 271 271 echo " 272 272 <tr class='active'> -
trunk/wp-admin/update.php
r13686 r13733 43 43 44 44 iframe_footer(); 45 45 46 46 } elseif ( 'upgrade-plugin' == $action ) { 47 47 if ( ! current_user_can('update_plugins') ) -
trunk/wp-admin/upload.php
r13690 r13733 397 397 echo esc_html( strtoupper( $matches[1] ) ); 398 398 else 399 echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) ); 399 echo strtoupper( str_replace( 'image/', '', get_post_mime_type() ) ); 400 400 ?> 401 401 -
trunk/wp-includes/default-filters.php
r13652 r13733 87 87 } 88 88 89 // Format titles 89 // Format titles 90 90 foreach ( array( 'single_post_title', 'single_cat_title', 'single_tag_title', 'single_month_title' ) as $filter ) { 91 91 add_filter( $filter, 'wptexturize' ); -
trunk/wp-includes/default-widgets.php
r13712 r13733 1030 1030 1031 1031 function _get_current_taxonomy($instance) { 1032 if ( !empty($instance['taxonomy']) && is_taxonomy($instance['taxonomy']) ) 1032 if ( !empty($instance['taxonomy']) && is_taxonomy($instance['taxonomy']) ) 1033 1033 return $instance['taxonomy']; 1034 1034 … … 1048 1048 parent::WP_Widget( 'nav_menu', __('Navigation Menu'), $widget_ops ); 1049 1049 } 1050 1050 1051 1051 function widget($args, $instance) { 1052 1052 // Get menu 1053 1053 $nav_menu = wp_get_nav_menu_object( $instance['nav_menu'] ); 1054 1054 1055 1055 if ( !$nav_menu ) 1056 return; 1057 1056 return; 1057 1058 1058 echo $args['before_widget']; 1059 1059 1060 1060 if ( isset($instance['title']) ) 1061 1061 echo $args['before_title'] . $instance['title'] . $args['after_title']; 1062 1062 1063 1063 wp_nav_menu( array( 'menu' => $nav_menu ) ); 1064 1064 1065 1065 echo $args['after_widget']; 1066 1066 } … … 1075 1075 $title = isset( $instance['title'] ) ? $instance['title'] : ''; 1076 1076 $nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : ''; 1077 1077 1078 1078 // Get menus 1079 1079 $menus = get_terms( 'nav_menu', array( 'hide_empty' => false ) ); 1080 1080 1081 1081 // If no menus exists, direct the user to go and create some. 1082 1082 if ( !$menus ) { -
trunk/wp-includes/formatting.php
r13725 r13733 757 757 * 758 758 * @since 3.0.0 759 * 759 * 760 760 * @param string $key String key 761 761 * @return string Sanitized key -
trunk/wp-includes/functions.php
r13725 r13733 1826 1826 continue; 1827 1827 if ( defined( 'CUSTOM_USER_META_TABLE' ) && CUSTOM_USER_META_TABLE == $table ) 1828 continue; 1828 continue; 1829 1829 1830 1830 // If visiting repair.php, return true and let it take over. -
trunk/wp-includes/l10n.php
r13330 r13733 317 317 /** 318 318 * Unloads translations for a domain 319 * 319 * 320 320 * @since 3.0.0 321 321 * @param string $domain Textdomain to be unloaded -
trunk/wp-includes/link-template.php
r13683 r13733 2060 2060 * 2061 2061 * @since 3.0.0. 2062 * 2062 * 2063 2063 * @param int $id A post or blog id. Default is 0, which means the current post or blog. 2064 2064 * @param string $contex Whether the id is a 'blog' id, 'post' id, or 'media' id. If 'post', the post_type of the post is consulted. If 'query', the current query is consulted to determine the id and context. Default is 'post'. -
trunk/wp-includes/nav-menu-template.php
r13731 r13733 26 26 $defaults = array( 'menu' => '', 'container' => 'div', 'container_class' => '', 'menu_class' => 'menu', 'echo' => true, 27 27 'fallback_cb' => 'wp_page_menu', 'before_link' => '', 'after_link' => '', 'before_title' => '', 'after_title' => '', ); 28 28 29 29 $args = wp_parse_args( $args, $defaults ); 30 30 $args = apply_filters( 'wp_nav_menu_args', $args ); … … 33 33 // Get the nav menu 34 34 $menu = wp_get_nav_menu_object( $args->menu ); 35 35 36 36 // If we couldn't find a menu based off the name, id or slug, 37 37 // get the first menu that has items. … … 52 52 if ( 'div' == $args->container ) { 53 53 $class = $args->container_class ? ' class="' . esc_attr($args->container_class) . '"' : ''; 54 54 55 55 if ( is_nav_menu($menu) ) { 56 56 $nav_menu .= '<div id="menu-' . $menu->slug . '"'. $class .'>'; … … 64 64 if ( 'div' == $args->container ) 65 65 $nav_menu .= '</div>'; 66 66 67 67 $nav_menu = apply_filters( 'wp_nav_menu', $nav_menu, $args ); 68 68 … … 86 86 $defaults = array( 'menu' => '', 'menu_class' => 'menu', 'context' => 'frontend', 87 87 'fallback_cb' => '', 'before_link' => '', 'after_link' => '', 'before_title' => '', 'after_title' => '', ); 88 88 89 89 $args = wp_parse_args( $args, $defaults ); 90 90 $args = apply_filters( 'wp_get_nav_menu_args', $args ); 91 91 $args = (object) $args; 92 92 93 93 // Variable setup 94 94 $nav_menu = ''; … … 97 97 $parent_stack = array(); 98 98 $parent_menu_order = array(); 99 99 100 100 // Get the menu object 101 101 $menu = wp_get_nav_menu_object( $args->menu ); 102 102 103 103 // If the menu exists, get it's items. 104 104 if ( $menu && !is_wp_error($menu) ) 105 105 $menu_items = wp_get_nav_menu_items( $menu->term_id, 'backend' ); 106 106 107 107 // If no menu was found or if the menu has no items, call the fallback_cb 108 108 if ( !$menu || is_wp_error($menu) || ( isset($menu_items) && empty($menu_items) ) ) { … … 112 112 } 113 113 } 114 114 115 115 foreach ( $menu_items as $key => $menu_item ) { 116 116 // Set up the $menu_item variables … … 120 120 $maybe_value = 'frontend' == $args->context ? '' : ' value="'. $menu_item->ID .'"'; 121 121 $classes = 'frontend' == $args->context ? ' class="menu-item-type-'. $type . $menu_item->li_class .'"' : ''; 122 122 123 123 $items .= '<li id="menu-item-'. $menu_item->ID .'"'. $maybe_value . $classes .'>'; 124 124 $items .= wp_get_nav_menu_item( $menu_item, $args->context, $args ); 125 125 126 126 // Indent children 127 127 $last_item = ( count( $menu_items ) == $menu_item->menu_order ); … … 142 142 } 143 143 } 144 144 145 145 // CSS class 146 146 $ul_class = $args->menu_class ? ' class="'. $args->menu_class .'"' : ''; 147 147 $nav_menu .= '<ul'. $ul_class .'>'; 148 148 149 149 // Allow plugins to hook into the menu to add their own <li>'s 150 150 if ( 'frontend' == $args->context ) { … … 155 155 $nav_menu .= $items; 156 156 } 157 157 158 158 $nav_menu .= '</ul>'; 159 159 160 160 return apply_filters( 'wp_get_nav_menu', $nav_menu ); 161 161 } … … 180 180 $attributes .= ( isset($menu_item->xfn) && '' != $menu_item->xfn ) ? ' rel="'. esc_attr($menu_item->xfn) .'"' : ''; 181 181 $attributes .= ( isset($menu_item->url) && '' != $menu_item->url ) ? ' href="'. esc_attr($menu_item->url) .'"' : ''; 182 182 183 183 $output .= esc_html( $args->before_link ); 184 184 $output .= '<a'. $attributes .'>'; … … 186 186 $output .= '</a>'; 187 187 $output .= esc_html( $args->after_link ); 188 189 break; 190 188 189 break; 190 191 191 case 'backend': 192 192 $output .= '<dl><dt>'; … … 205 205 } 206 206 $output .= '<span class="item-type">'. esc_html($label) .'</span>'; 207 207 208 208 // Actions 209 209 $output .= '<a class="item-edit thickbox" id="edit'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->menu_order ) .'" title="'. __('Edit Menu Item') .'" href="#TB_inline?height=540&width=300&inlineId=menu-item-settings">'. __('Edit') .'</a> | '; 210 210 $output .= '<a class="item-delete" id="delete'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->menu_order ) .'">'. __('Delete') .'</a>'; 211 211 212 212 $output .= '</dt></dl>'; 213 213 214 214 // Menu Item Settings 215 215 $output .= '<input type="hidden" name="menu-item-db-id[]" id="menu-item-db-id'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->ID ) .'" />'; … … 227 227 $output .= '<input type="hidden" name="menu-item-target[]" id="menu-item-target'. esc_attr( $menu_item->menu_order ) .'" value="'. esc_attr( $menu_item->target ) .'" />'; 228 228 break; 229 229 230 230 case 'custom': 231 231 $menu_id = 'menu-item-' . $menu_item->db_id; 232 232 $output .= '<label class="menu-item-title"><input type="checkbox" id="'. esc_attr( $menu_id ) .'" name="'. esc_attr( $menu_item->title ) .'" value="'. esc_attr( $menu_item->url ) .'" />'. $menu_item->title .'</label>'; 233 233 234 234 // Menu item hidden fields 235 235 $output .= '<input type="hidden" class="menu-item-db-id" value="'. esc_attr( $menu_item->db_id ) .'" />'; … … 246 246 $output .= '<input type="hidden" class="menu-item-xfn" value="'. esc_attr( $menu_item->xfn ) .'" />'; 247 247 break; 248 248 249 249 case 'taxonomy': 250 250 case 'post_type': 251 251 $menu_id = 'menu-item-' . $menu_item->db_id; 252 252 $output .= '<label class="menu-item-title"><input type="checkbox" id="'. esc_attr( $menu_id ) .'" name="'. esc_attr( $menu_item->title ) .'" value="'. esc_attr( $menu_item->url ) .'" />'. $menu_item->title .'</label>'; 253 253 254 254 // Menu item hidden fields 255 255 $output .= '<input type="hidden" class="menu-item-db-id" value="0" />'; … … 263 263 break; 264 264 } 265 265 266 266 return $output; 267 267 } -
trunk/wp-includes/nav-menu.php
r13722 r13733 119 119 * 120 120 * @param string $menu menu name, id, or slug 121 * @param string $args 121 * @param string $args 122 122 * @return mixed $items array of menu items, else false. 123 123 */ 124 124 function wp_get_nav_menu_items( $menu, $args = array() ) { 125 125 $menu = wp_get_nav_menu_object( $menu ); 126 126 127 127 if ( !$menu ) 128 128 return false; 129 129 130 130 $items = get_objects_in_term( $menu->term_id, 'nav_menu' ); 131 131 … … 133 133 $defaults = array( 'orderby' => 'menu_order', 'post_type' => 'nav_menu_item', 'post_status' => 'publish', 'output' => ARRAY_A, 'output_key' => 'menu_order' ); 134 134 $args = wp_parse_args( $args, $defaults ); 135 if ( count( $items ) > 1 ) 135 if ( count( $items ) > 1 ) 136 136 $args['include'] = implode( ',', $items ); 137 137 else … … 165 165 function wp_setup_nav_menu_item( $menu_item, $menu_item_type = null, $menu_item_object = '' ) { 166 166 global $wp_query; 167 167 168 168 switch ( $menu_item_type ) { 169 169 case 'frontend': … … 174 174 175 175 $menu_item->append = get_post_meta( $menu_item->ID, 'menu_item_append', true ); 176 176 177 177 $menu_item->title = $menu_item->post_title; 178 178 $menu_item->url = get_post_meta( $menu_item->ID, 'menu_item_url', true ); 179 179 $menu_item->target = get_post_meta( $menu_item->ID, 'menu_item_target', true ); 180 180 181 181 $menu_item->attr_title = strip_tags( $menu_item->post_excerpt ); 182 182 $menu_item->description = strip_tags( $menu_item->post_content ); 183 183 184 184 $menu_item->classes = get_post_meta( $menu_item->ID, 'menu_item_classes', true );; 185 185 $menu_item->xfn = get_post_meta( $menu_item->ID, 'menu_item_xfn', true ); 186 186 $menu_item->li_class = ( $menu_item->object_id == $wp_query->get_queried_object_id() ) ? ' current_page_item' : ''; 187 187 break; 188 188 189 189 case 'custom': 190 190 $menu_item->db_id = (int) $menu_item->ID; … … 193 193 $menu_item->type = 'custom'; //$menu_item_type 194 194 $menu_item->append = 'custom'; 195 195 196 196 $menu_item->attr_title = strip_tags( $menu_item->post_excerpt ); 197 197 $menu_item->description = strip_tags( $menu_item->post_content ); … … 201 201 $menu_item->target = get_post_meta( $menu_item->ID, 'menu_item_target', true ); 202 202 break; 203 203 204 204 case 'post_type': 205 205 $menu_item->db_id = 0; … … 207 207 $menu_item->parent_id = (int) $menu_item->post_parent; 208 208 $menu_item->type = $menu_item_type; 209 209 210 210 $object = get_post_type_object( $menu_item_object ); 211 211 $menu_item->append = $object->name; … … 214 214 $menu_item->url = get_permalink( $menu_item->ID ); 215 215 $menu_item->target = '_self'; 216 216 217 217 $menu_item->attr_title = ''; 218 218 $menu_item->description = strip_tags( $menu_item->post_content ); 219 219 break; 220 220 221 221 case 'taxonomy': 222 222 $menu_item->ID = $menu_item->term_id; … … 225 225 $menu_item->parent_id = (int) $menu_item->parent; 226 226 $menu_item->type = $menu_item_type; 227 227 228 228 $object = get_taxonomy( $menu_item_object ); 229 229 $menu_item->append = $object->name; … … 239 239 $menu_item->classes = get_post_meta( $menu_item->ID, 'menu_item_classes', true ); 240 240 $menu_item->xfn = get_post_meta( $menu_item->ID, 'menu_item_xfn', true ); 241 241 242 242 return $menu_item; 243 243 } -
trunk/wp-includes/pluggable.php
r13657 r13733 167 167 168 168 $results = $wpdb->get_results("SELECT * FROM $wpdb->users WHERE ID IN ($list)"); 169 169 170 170 _fill_many_users($results); 171 171 } -
trunk/wp-includes/post.php
r13717 r13733 2931 2931 $number = (int) $number; 2932 2932 $offset = (int) $offset; 2933 2933 2934 2934 // Make sure the post type is hierarchical 2935 2935 $hierarchical_post_types = get_post_types( array( 'hierarchical' => true ) ); 2936 2936 if ( !in_array( $post_type, $hierarchical_post_types ) ) 2937 2937 return false; 2938 2938 2939 2939 // Make sure we have a valid post status 2940 2940 if ( !in_array($post_status, get_post_stati()) ) … … 3032 3032 if ( $parent >= 0 ) 3033 3033 $where .= $wpdb->prepare(' AND post_parent = %d ', $parent); 3034 3034 3035 3035 $where_post_type = $wpdb->prepare( "post_type = '%s' AND post_status = '%s'", $post_type, $post_status ); 3036 3036 … … 3179 3179 else 3180 3180 $post_category = array(); 3181 } 3181 } 3182 3182 3183 3183 // Are we updating or creating? … … 3815 3815 if ( $lastpostmodified ) 3816 3816 return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone ); 3817 3817 3818 3818 switch ( strtolower($timezone) ) { 3819 3819 case 'gmt': … … 3827 3827 break; 3828 3828 } 3829 3829 3830 3830 $lastpostdate = get_lastpostdate($timezone); 3831 3831 if ( $lastpostdate > $lastpostmodified ) 3832 3832 $lastpostmodified = $lastpostdate; 3833 3833 3834 if ( $lastpostmodified ) 3835 wp_cache_set( "lastpostmodified:$timezone", $lastpostmodified, 'timeinfo' ); 3834 if ( $lastpostmodified ) 3835 wp_cache_set( "lastpostmodified:$timezone", $lastpostmodified, 'timeinfo' ); 3836 3836 3837 3837 return apply_filters( 'get_lastpostmodified', $lastpostmodified, $timezone ); -
trunk/wp-includes/query.php
r13725 r13733 225 225 * 226 226 * If no taxonomy argument is set, returns true if any taxonomy is queried. 227 * If the taxonomy argument is passed but no term argument, returns true 227 * If the taxonomy argument is passed but no term argument, returns true 228 228 * if the taxonomy or taxonomies in the argument are being queried. 229 * If both taxonomy and term arguments are passed, returns true 229 * If both taxonomy and term arguments are passed, returns true 230 230 * if the current query is for a term contained in the terms argument 231 231 * which has a taxonomy contained in the taxonomy argument. … … 254 254 return isset($queried_object->taxonomy) && count( $tax_array ) && in_array($queried_object->taxonomy, $tax_array); 255 255 256 return isset($queried_object->term_id) && 256 return isset($queried_object->term_id) && 257 257 count(array_intersect( 258 array($queried_object->term_id, $queried_object->name, $queried_object->slug), 258 array($queried_object->term_id, $queried_object->name, $queried_object->slug), 259 259 $term_array 260 260 )); -
trunk/wp-includes/rewrite.php
r13689 r13733 1781 1781 $siteurl = get_option( 'siteurl' ); 1782 1782 $siteurl_len = strlen( $siteurl ); 1783 if ( substr( WP_CONTENT_URL, 0, $siteurl_len ) == $siteurl && strlen( WP_CONTENT_URL ) > $siteurl_len ) 1783 if ( substr( WP_CONTENT_URL, 0, $siteurl_len ) == $siteurl && strlen( WP_CONTENT_URL ) > $siteurl_len ) 1784 1784 $content_path = substr( WP_CONTENT_URL, $siteurl_len + 1 ); 1785 1785 else 1786 $content_path = 'wp-content'; 1786 $content_path = 'wp-content'; 1787 1787 $rules = '<rule name="wordpress - strip index.php" stopProcessing="false"> 1788 1788 <match url="^index.php/(.*)$" /> -
trunk/wp-includes/taxonomy.php
r13704 r13733 161 161 function is_taxonomy( $taxonomy ) { 162 162 global $wp_taxonomies; 163 163 164 164 return isset($wp_taxonomies[$taxonomy]); 165 165 } … … 262 262 263 263 if ( false !== $args['rewrite'] && '' != get_option('permalink_structure') ) { 264 $args['rewrite'] = wp_parse_args($args['rewrite'], array( 265 'slug' => sanitize_title_with_dashes($taxonomy), 266 'with_front' => true, 267 )); 268 $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term="); 269 $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']); 264 $args['rewrite'] = wp_parse_args($args['rewrite'], array( 265 'slug' => sanitize_title_with_dashes($taxonomy), 266 'with_front' => true, 267 )); 268 $wp_rewrite->add_rewrite_tag("%$taxonomy%", '([^/]+)', $args['query_var'] ? "{$args['query_var']}=" : "taxonomy=$taxonomy&term="); 269 $wp_rewrite->add_permastruct($taxonomy, "{$args['rewrite']['slug']}/%$taxonomy%", $args['rewrite']['with_front']); 270 270 } 271 271 -
trunk/wp-signup.php
r13629 r13733 236 236 else 237 237 $signup[ 'blog' ] = 'checked="checked"'; 238 238 239 239 //TODO - This doesn't seem to do anything do we really need it? 240 240 $signup['user'] = isset( $signup['user'] ) ? $signup['user'] : '';
Note: See TracChangeset
for help on using the changeset viewer.