Changeset 49301
- Timestamp:
- 10/24/2020 02:10:26 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r49172 r49301 1345 1345 1346 1346 if ( $request['id'] ) { 1347 $post = get_post( $request['id'] ); 1347 1348 $current_template = get_page_template_slug( $request['id'] ); 1348 1349 } else { 1350 $post = null; 1349 1351 $current_template = ''; 1350 1352 } … … 1356 1358 1357 1359 // If this is a create request, get_post() will return null and wp theme will fallback to the passed post type. 1358 $allowed_templates = wp_get_theme()->get_page_templates( get_post( $request['id'] ), $this->post_type );1360 $allowed_templates = wp_get_theme()->get_page_templates( $post, $this->post_type ); 1359 1361 1360 1362 if ( isset( $allowed_templates[ $template ] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.