Ticket #18722: 18722.no-global.2.diff
File 18722.no-global.2.diff, 2.9 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/class-wp-terms-list-table.php
283 283 } 284 284 285 285 function column_posts( $tag ) { 286 global $taxonomy , $post_type;286 global $taxonomy; 287 287 288 288 $count = number_format_i18n( $tag->count ); 289 289 290 290 $tax = get_taxonomy( $taxonomy ); 291 291 292 $post_type = get_current_screen()->post_type; 292 293 $ptype_object = get_post_type_object( $post_type ); 294 293 295 if ( ! $ptype_object->show_ui ) 294 296 return $count; 295 297 -
wp-admin/includes/screen.php
445 445 446 446 $base = $id; 447 447 448 // If this is the current screen, see if we can be more accurate for post types and taxonomies. 449 if ( ! $hook_name ) { 450 if ( isset( $_REQUEST['post_type'] ) ) 451 $post_type = post_type_exists( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : false; 452 if ( isset( $_REQUEST['taxonomy'] ) ) 453 $taxonomy = taxonomy_exists( $_REQUEST['taxonomy'] ) ? $_REQUEST['taxonomy'] : false; 448 // If post_type or taxonomy haven't been determined yet, check further. 449 if ( ! $post_type && isset( $_REQUEST['post_type'] ) ) 450 $post_type = post_type_exists( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : false; 451 if ( ! $taxonomy && isset( $_REQUEST['taxonomy'] ) ) 452 $taxonomy = taxonomy_exists( $_REQUEST['taxonomy'] ) ? $_REQUEST['taxonomy'] : false; 454 453 455 switch ( $base ) {456 case 'post' :457 if ( isset( $_GET['post'] ) )458 $post_id = (int) $_GET['post'];459 elseif ( isset( $_POST['post_ID'] ) )460 $post_id = (int) $_POST['post_ID'];461 else462 $post_id = 0;463 464 if ( $post_id ) {465 $post = get_post( $post_id );466 if ( $post )467 $post_type = $post->post_type;468 }469 break;470 case 'edit-tags' :471 if ( null === $post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) )472 $post_type = 'post';473 break;474 }475 }476 477 454 switch ( $base ) { 478 455 case 'post' : 456 if ( isset( $_GET['post'] ) ) 457 $post_id = (int) $_GET['post']; 458 elseif ( isset( $_POST['post_ID'] ) ) 459 $post_id = (int) $_POST['post_ID']; 460 else 461 $post_id = 0; 462 463 if ( $post_id ) { 464 $post = get_post( $post_id ); 465 if ( $post ) 466 $post_type = $post->post_type; 467 } 479 468 if ( null === $post_type ) 480 469 $post_type = 'post'; 481 470 $id = $post_type; … … 488 477 case 'edit-tags' : 489 478 if ( null === $taxonomy ) 490 479 $taxonomy = 'post_tag'; 480 if ( null === $post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) ) 481 $post_type = 'post'; 491 482 $id = 'edit-' . $taxonomy; 492 483 break; 493 484 case 'upload' :