Changeset 19097
- Timestamp:
- 10/31/2011 09:28:17 PM (13 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin.php
r18731 r19097 89 89 } 90 90 91 if ( isset( $_GET['post_type']) )92 $typenow = sanitize_key($_GET['post_type']);91 if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) ) 92 $typenow = $_REQUEST['post_type']; 93 93 else 94 94 $typenow = ''; 95 95 96 if ( isset( $_GET['taxonomy']) )97 $taxnow = sanitize_key($_GET['taxonomy']);96 if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) ) 97 $taxnow = $_REQUEST['taxonomy']; 98 98 else 99 99 $taxnow = ''; -
trunk/wp-admin/includes/screen.php
r19092 r19097 419 419 420 420 $id = sanitize_key( $id ); 421 if ( false !== strpos( $id, '-' ) ) { 421 if ( post_type_exists( $id ) ) { 422 $post_type = $id; 423 $id = 'post'; // changes later. ends up being $base. 424 } elseif ( false !== strpos( $id, '-' ) ) { 422 425 list( $id, $second ) = explode( '-', $id, 2 ); 423 426 if ( taxonomy_exists( $second ) ) { … … 439 442 // If this is the current screen, see if we can be more accurate for post types and taxonomies. 440 443 if ( ! $hook_name ) { 444 if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) ) 445 $post_type = $_REQUEST['post_type']; 446 if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) ) 447 $taxonomy = $_REQUEST['taxonomy']; 448 441 449 switch ( $base ) { 442 450 case 'post' : … … 452 460 if ( $post ) 453 461 $post_type = $post->post_type; 454 } elseif ( isset( $_POST['post_type'] ) && post_type_exists( $_POST['post_type'] ) ) {455 $post_type = $_POST['post_type'];456 } elseif ( $action == 'add' && isset( $_GET['post_type'] ) && post_type_exists( $_GET['post_type'] ) ) {457 $post_type = $_GET['post_type'];458 462 } 459 463 break; 460 case 'edit' :461 if ( isset( $_GET['post_type'] ) && post_type_exists( $_GET['post_type'] ) )462 $post_type = $_GET['post_type'];463 break;464 464 case 'edit-tags' : 465 if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) ) 466 $taxonomy = $_REQUEST['taxonomy']; 467 if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) ) 468 $post_type = $_REQUEST['post_type']; 469 else if ( is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) ) 465 if ( ! $post_type && is_object_in_taxonomy( 'post', $taxonomy ? $taxonomy : 'post_tag' ) ) 470 466 $post_type = 'post'; 471 467 break; … … 499 495 } 500 496 501 if ( isset( self::$_registry[ $id ] ) ) 502 return self::$_registry[ $id ]; 503 504 $screen = new WP_Screen(); 505 $screen->id = $id; 497 if ( isset( self::$_registry[ $id ] ) ) { 498 $screen = self::$_registry[ $id ]; 499 if ( $screen === get_current_screen() ) 500 return $screen; 501 } else { 502 $screen = new WP_Screen(); 503 $screen->id = $id; 504 } 505 506 506 $screen->base = $base; 507 507 $screen->action = $action;
Note: See TracChangeset
for help on using the changeset viewer.