Changeset 31105 for trunk/src/wp-admin/admin.php
- Timestamp:
- 01/08/2015 10:14:58 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/admin.php
r31090 r31105 91 91 wp_enqueue_script( 'common' ); 92 92 93 // $pagenow is set in vars.php 94 // The remaining variables are imported as globals elsewhere, 95 // declared as globals here 96 global $pagenow, $hook_suffix, $plugin_page, $typenow, $taxnow; 97 98 $page_hook = ''; 99 $hook_suffix = ''; 100 $plugin_page = ''; 101 $typenow = ''; 102 $taxnow = ''; 103 93 104 $editing = false; 94 105 95 if ( isset( $_GET['page']) ) {106 if ( isset( $_GET['page'] ) ) { 96 107 $plugin_page = wp_unslash( $_GET['page'] ); 97 $plugin_page = plugin_basename( $plugin_page);98 } 99 100 if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) ) 108 $plugin_page = plugin_basename( $plugin_page ); 109 } 110 111 if ( isset( $_REQUEST['post_type'] ) && post_type_exists( $_REQUEST['post_type'] ) ) { 101 112 $typenow = $_REQUEST['post_type']; 102 else 103 $typenow = ''; 104 105 if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) ) 113 } 114 115 if ( isset( $_REQUEST['taxonomy'] ) && taxonomy_exists( $_REQUEST['taxonomy'] ) ) { 106 116 $taxnow = $_REQUEST['taxonomy']; 107 else 108 $taxnow = ''; 117 } 109 118 110 119 if ( WP_NETWORK_ADMIN ) … … 145 154 do_action( 'admin_init' ); 146 155 147 if ( isset($plugin_page)) {148 if ( !empty($typenow) )156 if ( $plugin_page ) { 157 if ( $typenow ) { 149 158 $the_parent = $pagenow . '?post_type=' . $typenow; 150 else159 } else { 151 160 $the_parent = $pagenow; 161 } 152 162 if ( ! $page_hook = get_plugin_page_hook($plugin_page, $the_parent) ) { 153 163 $page_hook = get_plugin_page_hook($plugin_page, $plugin_page); … … 167 177 } 168 178 169 $hook_suffix = ''; 170 if ( isset( $page_hook ) ) { 179 if ( $page_hook ) { 171 180 $hook_suffix = $page_hook; 172 } elseif ( isset( $plugin_page )) {181 } elseif ( $plugin_page ) { 173 182 $hook_suffix = $plugin_page; 174 } elseif ( isset( $pagenow )) {183 } elseif ( $pagenow ) { 175 184 $hook_suffix = $pagenow; 176 185 } … … 179 188 180 189 // Handle plugin admin pages. 181 if ( isset($plugin_page)) {190 if ( $plugin_page ) { 182 191 if ( $page_hook ) { 183 192 /**
Note: See TracChangeset
for help on using the changeset viewer.