Changeset 45588 for trunk/tests/phpunit/tests/admin/includesScreen.php
- Timestamp:
- 07/02/2019 04:43:01 AM (19 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/admin/includesScreen.php
r45224 r45588 172 172 173 173 foreach ( $this->core_screens as $hook_name => $screen ) { 174 $_GET = $_POST = $_REQUEST = array(); 175 $GLOBALS['taxnow'] = $GLOBALS['typenow'] = ''; 176 $screen = (object) $screen; 177 $hook = parse_url( $hook_name ); 174 $_GET = array(); 175 $_POST = array(); 176 $_REQUEST = array(); 177 $GLOBALS['taxnow'] = ''; 178 $GLOBALS['typenow'] = ''; 179 $screen = (object) $screen; 180 $hook = parse_url( $hook_name ); 178 181 179 182 if ( ! empty( $hook['query'] ) ) { 180 183 $args = wp_parse_args( $hook['query'] ); 181 184 if ( isset( $args['taxonomy'] ) ) { 182 $GLOBALS['taxnow'] = $_GET['taxonomy'] = $_POST['taxonomy'] = $_REQUEST['taxonomy'] = $args['taxonomy']; 185 $GLOBALS['taxnow'] = $args['taxonomy']; 186 $_GET['taxonomy'] = $args['taxonomy']; 187 $_POST['taxonomy'] = $args['taxonomy']; 188 $_REQUEST['taxonomy'] = $args['taxonomy']; 183 189 } 184 190 if ( isset( $args['post_type'] ) ) { 185 $GLOBALS['typenow'] = $_GET['post_type'] = $_POST['post_type'] = $_REQUEST['post_type'] = $args['post_type']; 191 $GLOBALS['typenow'] = $args['post_type']; 192 $_GET['post_type'] = $args['post_type']; 193 $_POST['post_type'] = $args['post_type']; 194 $_REQUEST['post_type'] = $args['post_type']; 186 195 } elseif ( isset( $screen->post_type ) ) { 187 $GLOBALS['typenow'] = $_GET['post_type'] = $_POST['post_type'] = $_REQUEST['post_type'] = $screen->post_type; 196 $GLOBALS['typenow'] = $screen->post_type; 197 $_GET['post_type'] = $screen->post_type; 198 $_POST['post_type'] = $screen->post_type; 199 $_REQUEST['post_type'] = $screen->post_type; 188 200 } 189 201 } … … 485 497 register_post_type( 'type_shows_in_rest', array( 'show_in_rest' => true ) ); 486 498 487 $GLOBALS['typenow'] = $_GET['post_type'] = $_POST['post_type'] = $_REQUEST['post_type'] = 'type_shows_in_rest'; 499 $GLOBALS['typenow'] = 'type_shows_in_rest'; 500 $_GET['post_type'] = 'type_shows_in_rest'; 501 $_POST['post_type'] = 'type_shows_in_rest'; 502 $_REQUEST['post_type'] = 'type_shows_in_rest'; 488 503 $GLOBALS['hook_suffix'] = $hook; 489 504
Note: See TracChangeset
for help on using the changeset viewer.