関数 get_post_comments_feed_link()
2015/01/14
関数 get_post_comments_feed_link()
定義ファイル :/blog/wp-includes/link-template.php 2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | function get_post_comments_feed_link($post_id = 0, $feed = '') { $post_id = absint( $post_id ); if ( ! $post_id ) $post_id = get_the_ID(); if ( empty( $feed ) ) $feed = get_default_feed(); if ( '' != get_option('permalink_structure') ) { if ( 'page' == get_option('show_on_front') && $post_id == get_option('page_on_front') ) $url = _get_page_link( $post_id ); else $url = get_permalink($post_id); $url = trailingslashit($url) . 'feed'; if ( $feed != get_default_feed() ) $url .= "/$feed"; $url = user_trailingslashit($url, 'single_feed'); } else { $type = get_post_field('post_type', $post_id); if ( 'page' == $type ) $url = add_query_arg( array( 'feed' => $feed, 'page_id' => $post_id ), home_url( '/' ) ); else $url = add_query_arg( array( 'feed' => $feed, 'p' => $post_id ), home_url( '/' ) ); } return apply_filters( 'post_comments_feed_link', $url ); } |