Changeset 25030 for trunk/src/wp-includes/link-template.php
- Timestamp:
- 08/15/2013 08:08:06 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r24940 r25030 2352 2352 global $wp_query; 2353 2353 $post_id = 0; 2354 if ( 'query' == $context && is_sing le() ) {2354 if ( 'query' == $context && is_singular() ) { 2355 2355 $post_id = $wp_query->get_queried_object_id(); 2356 $post = get_post( $post_id ); 2356 2357 } elseif ( 'post' == $context ) { 2357 $post = get_post( $id);2358 $post = get_post( $id ); 2358 2359 $post_id = $post->ID; 2359 2360 } … … 2361 2362 $shortlink = ''; 2362 2363 2363 // Return p= link for posts.2364 if ( ! empty($post_id) && '' != get_option('permalink_structure') ) {2365 $post = get_post($post_id);2366 if ( isset($post->post_type) && 'post' == $post->post_type)2367 $shortlink = home_url('?p=' . $post ->ID);2364 // Return p= link for all public post types. 2365 if ( ! empty( $post_id ) ) { 2366 $post_type = get_post_type_object( $post->post_type ); 2367 if ( $post_type->public ) 2368 $shortlink = home_url('?p=' . $post_id); 2368 2369 } 2369 2370
Note: See TracChangeset
for help on using the changeset viewer.