WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/31/2011 09:28:17 PM (10 years ago)
Author:
nacin
Message:

Consistently set taxnow/typenow and the current screen's post_type/taxnomy, whenever it can be detected. Allow WP_Screen::get() to accept a post type as a hook_name. Fixes issues with the meta box $page/$screen argument. fixes #19080. see #18785.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin.php

    r18731 r19097  
    8989}
    9090
    91 if ( isset($_GET['post_type']) )
    92     $typenow = sanitize_key($_GET['post_type']);
     91if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) )
     92    $typenow = $_REQUEST['post_type'];
    9393else
    9494    $typenow = '';
    9595
    96 if ( isset($_GET['taxonomy']) )
    97     $taxnow = sanitize_key($_GET['taxonomy']);
     96if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) )
     97    $taxnow = $_REQUEST['taxonomy'];
    9898else
    9999    $taxnow = '';
Note: See TracChangeset for help on using the changeset viewer.