Ticket #30406: 30406.2.patch
File 30406.2.patch, 13.2 KB (added by , 10 years ago) |
---|
-
src/wp-includes/link-template.php
35 35 * 36 36 * @param string $string URL with or without a trailing slash. 37 37 * @param string $type_of_url The type of URL being considered (e.g. single, category, etc) for use in the filter. 38 * @return string 38 * @return string The URL with the trailing slash appended or stripped. 39 39 */ 40 40 function user_trailingslashit($string, $type_of_url = '') { 41 41 global $wp_rewrite; … … 239 239 * @param int $id Optional. Post ID. 240 240 * @param bool $leavename Optional, defaults to false. Whether to keep post name. 241 241 * @param bool $sample Optional, defaults to false. Is it a sample permalink. 242 * @return string 242 * @return string The post permalink. 243 243 */ 244 244 function get_post_permalink( $id = 0, $leavename = false, $sample = false ) { 245 245 global $wp_rewrite; … … 313 313 * @param int|object $post Optional. Post ID or object. 314 314 * @param bool $leavename Optional, defaults to false. Whether to keep page name. 315 315 * @param bool $sample Optional, defaults to false. Is it a sample permalink. 316 * @return string 316 * @return string The page permalink. 317 317 */ 318 318 function get_page_link( $post = false, $leavename = false, $sample = false ) { 319 319 $post = get_post( $post ); … … 346 346 * @param int|object $post Optional. Post ID or object. 347 347 * @param bool $leavename Optional. Leave name. 348 348 * @param bool $sample Optional. Sample permalink. 349 * @return string 349 * @return string The page permalink. 350 350 */ 351 351 function _get_page_link( $post = false, $leavename = false, $sample = false ) { 352 352 global $wp_rewrite; … … 388 388 * 389 389 * @param int|object $post Optional. Post ID or object. 390 390 * @param bool $leavename Optional. Leave name. 391 * @return string 391 * @return string The attachment permalink. 392 392 */ 393 393 function get_attachment_link( $post = null, $leavename = false ) { 394 394 global $wp_rewrite; … … 436 436 * @since 1.5.0 437 437 * 438 438 * @param int|bool $year False for current year or year for permalink. 439 * @return string 439 * @return string The permalink for the specified year archive. 440 440 */ 441 441 function get_year_link($year) { 442 442 global $wp_rewrite; … … 468 468 * 469 469 * @param bool|int $year False for current year. Integer of year. 470 470 * @param bool|int $month False for current month. Integer of month. 471 * @return string 471 * @return string The permalink for the specified month and year archive. 472 472 */ 473 473 function get_month_link($year, $month) { 474 474 global $wp_rewrite; … … 505 505 * @param bool|int $year False for current year. Integer of year. 506 506 * @param bool|int $month False for current month. Integer of month. 507 507 * @param bool|int $day False for current day. Integer of day. 508 * @return string 508 * @return string The permalink for the specified day, month, and year archive. 509 509 */ 510 510 function get_day_link($year, $month, $day) { 511 511 global $wp_rewrite; … … 568 568 * @since 1.5.0 569 569 * 570 570 * @param string $feed Optional, defaults to default feed. Feed type. 571 * @return string 571 * @return string The feed permalink. 572 572 */ 573 573 function get_feed_link($feed = '') { 574 574 global $wp_rewrite; … … 614 614 * 615 615 * @param int $post_id Optional. Post ID. 616 616 * @param string $feed Optional. Feed type. 617 * @return string 617 * @return string The permalink for the comments feed for the given post. 618 618 */ 619 619 function get_post_comments_feed_link($post_id = 0, $feed = '') { 620 620 $post_id = absint( $post_id ); … … 833 833 * 834 834 * @param int $tag_id Tag ID. 835 835 * @param string $feed Optional. Feed type. 836 * @return string 836 * @return string The feed permalink for the given tag. 837 837 */ 838 838 function get_tag_feed_link($tag_id, $feed = '') { 839 839 return get_term_feed_link($tag_id, 'post_tag', $feed); … … 846 846 * 847 847 * @param int $tag_id Tag ID 848 848 * @param string $taxonomy Taxonomy 849 * @return string 849 * @return string The edit tag link URL for the given tag. 850 850 */ 851 851 function get_edit_tag_link( $tag_id, $taxonomy = 'post_tag' ) { 852 852 /** … … 891 891 * @param int $term_id Term ID 892 892 * @param string $taxonomy Taxonomy 893 893 * @param string $object_type The object type 894 * @return string 894 * @return string The edit term link URL for the given term. 895 895 */ 896 896 function get_edit_term_link( $term_id, $taxonomy, $object_type = '' ) { 897 897 $tax = get_taxonomy( $taxonomy ); … … 973 973 * @since 3.0.0 974 974 * 975 975 * @param string $query Optional. The query string to use. If empty the current query is used. 976 * @return string 976 * @return string The search permalink. 977 977 */ 978 978 function get_search_link( $query = '' ) { 979 979 global $wp_rewrite; … … 1012 1012 * 1013 1013 * @param string $search_query Optional. Search query. 1014 1014 * @param string $feed Optional. Feed type. 1015 * @return string 1015 * @return string The search results feed permalink. 1016 1016 */ 1017 1017 function get_search_feed_link($search_query = '', $feed = '') { 1018 1018 global $wp_rewrite; … … 1051 1051 * 1052 1052 * @param string $search_query Optional. Search query. 1053 1053 * @param string $feed Optional. Feed type. 1054 * @return string 1054 * @return string The comments feed search results permalink. 1055 1055 */ 1056 1056 function get_search_comments_feed_link($search_query = '', $feed = '') { 1057 1057 global $wp_rewrite; … … 1080 1080 * @since 3.1.0 1081 1081 * 1082 1082 * @param string $post_type Post type 1083 * @return string 1083 * @return string The post type archive permalink. 1084 1084 */ 1085 1085 function get_post_type_archive_link( $post_type ) { 1086 1086 global $wp_rewrite; … … 1119 1119 * 1120 1120 * @param string $post_type Post type 1121 1121 * @param string $feed Optional. Feed type 1122 * @return string 1122 * @return string The post type feed permalink. 1123 1123 */ 1124 1124 function get_post_type_archive_feed_link( $post_type, $feed = '' ) { 1125 1125 $default_feed = get_default_feed(); … … 1160 1160 * 1161 1161 * @param int $id Optional. Post ID. 1162 1162 * @param string $context Optional, defaults to display. How to write the '&', defaults to '&'. 1163 * @return string 1163 * @return string The edit post link for the given post. 1164 1164 */ 1165 1165 function get_edit_post_link( $id = 0, $context = 'display' ) { 1166 1166 if ( ! $post = get_post( $id ) ) … … 1240 1240 * @param int $id Optional. Post ID. 1241 1241 * @param string $deprecated Not used. 1242 1242 * @param bool $force_delete Whether to bypass trash and force deletion. Default is false. 1243 * @return string 1243 * @return string The delete post link URL for the given post. 1244 1244 */ 1245 1245 function get_delete_post_link( $id = 0, $deprecated = '', $force_delete = false ) { 1246 1246 if ( ! empty( $deprecated ) ) … … 1278 1278 * @since 2.3.0 1279 1279 * 1280 1280 * @param int $comment_id Optional. Comment ID. 1281 * @return string 1281 * @return string The edit comment link URL for the given comment. 1282 1282 */ 1283 1283 function get_edit_comment_link( $comment_id = 0 ) { 1284 1284 $comment = get_comment( $comment_id ); … … 1338 1338 * @since 2.7.0 1339 1339 * 1340 1340 * @param int $link Optional. Bookmark ID. 1341 * @return string 1341 * @return string The edit bookmark link URL. 1342 1342 */ 1343 1343 function get_edit_bookmark_link( $link = 0 ) { 1344 1344 $link = get_bookmark( $link ); … … 1594 1594 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 1595 1595 * @param bool $previous Optional. Whether to display link to previous or next post. Default true. 1596 1596 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 1597 * @return string 1597 * @return string The adjacent post relational link URL. 1598 1598 */ 1599 1599 function get_adjacent_post_rel_link( $title = '%title', $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) { 1600 1600 if ( $previous && is_attachment() && $post = get_post() ) … … 1759 1759 * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. 1760 1760 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 1761 1761 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 1762 * @return string 1762 * @return string The link URL of the previous post in relation to the current post. 1763 1763 */ 1764 1764 function get_previous_post_link( $format = '« %link', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { 1765 1765 return get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, true, $taxonomy ); … … 1791 1791 * @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. 1792 1792 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded term IDs. 1793 1793 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 1794 * @return string 1794 * @return string The link URL of the next post in relation to the current post. 1795 1795 */ 1796 1796 function get_next_post_link( $format = '%link »', $link = '%title', $in_same_term = false, $excluded_terms = '', $taxonomy = 'category' ) { 1797 1797 return get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, false, $taxonomy ); … … 1826 1826 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded terms IDs. 1827 1827 * @param bool $previous Optional. Whether to display link to previous or next post. Default true. 1828 1828 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 1829 * @return string 1829 * @return string The link URL of the previous or next post in relation to the current post. 1830 1830 */ 1831 1831 function get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) { 1832 1832 if ( $previous && is_attachment() ) … … 1887 1887 * @param array|string $excluded_terms Optional. Array or comma-separated list of excluded category IDs. 1888 1888 * @param bool $previous Optional. Whether to display link to previous or next post. Default true. 1889 1889 * @param string $taxonomy Optional. Taxonomy, if $in_same_term is true. Default 'category'. 1890 * @return string1891 1890 */ 1892 1891 function adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms = '', $previous = true, $taxonomy = 'category' ) { 1893 1892 echo get_adjacent_post_link( $format, $link, $in_same_term, $excluded_terms, $previous, $taxonomy ); … … 1901 1900 * @param int $pagenum Optional. Page ID. 1902 1901 * @param bool $escape Optional. Whether to escape the URL for display, with esc_url(). Defaults to true. 1903 1902 * Otherwise, prepares the URL with esc_url_raw(). 1904 * @return string 1903 * @return string The link URL for the given page number. 1905 1904 */ 1906 1905 function get_pagenum_link($pagenum = 1, $escape = true ) { 1907 1906 global $wp_rewrite; … … 1975 1974 * @since 2.0.10 1976 1975 * 1977 1976 * @param int $max_page Optional. Max pages. 1978 * @return string 1977 * @return string The link URL for next posts page. 1979 1978 */ 1980 1979 function get_next_posts_page_link($max_page = 0) { 1981 1980 global $paged; … … 1996 1995 * 1997 1996 * @param int $max_page Optional. Max pages. 1998 1997 * @param boolean $echo Optional. Echo or return; 1998 * @return string The link URL for next posts page if `$echo = false`. 1999 1999 */ 2000 2000 function next_posts( $max_page = 0, $echo = true ) { 2001 2001 $output = esc_url( get_next_posts_page_link( $max_page ) ); … … 2013 2013 * 2014 2014 * @param string $label Content for link text. 2015 2015 * @param int $max_page Optional. Max pages. 2016 * @return string|null 2016 * @return string|null HTML-formatted next posts page link. 2017 2017 */ 2018 2018 function get_next_posts_link( $label = null, $max_page = 0 ) { 2019 2019 global $paged, $wp_query; … … 2064 2064 * 2065 2065 * @since 2.0.10 2066 2066 * 2067 * @return string|null 2067 * @return string|null The link for the previous posts page. 2068 2068 */ 2069 2069 function get_previous_posts_page_link() { 2070 2070 global $paged; … … 2083 2083 * @since 0.71 2084 2084 * 2085 2085 * @param boolean $echo Optional. Echo or return; 2086 * @return string The previous posts page link if `$echo = false`. 2086 2087 */ 2087 2088 function previous_posts( $echo = true ) { 2088 2089 $output = esc_url( get_previous_posts_page_link() ); … … 2099 2100 * @since 2.7.0 2100 2101 * 2101 2102 * @param string $label Optional. Previous page link text. 2102 * @return string|null 2103 * @return string|null HTML-formatted previous page link. 2103 2104 */ 2104 2105 function get_previous_posts_link( $label = null ) { 2105 2106 global $paged; … … 2371 2372 * @since 2.7.0 2372 2373 * 2373 2374 * @param int $pagenum Optional. Page number. 2374 * @return string 2375 * @param int $max_page Optional. The maximum number of comment pages. 2376 * @return string The comments page number link URL. 2375 2377 */ 2376 2378 function get_comments_pagenum_link( $pagenum = 1, $max_page = 0 ) { 2377 2379 global $wp_rewrite; … … 2415 2417 * 2416 2418 * @param string $label Optional. Label for link text. 2417 2419 * @param int $max_page Optional. Max page. 2418 * @return string|null 2420 * @return string|null HTML-formatted link for the next page of comments. 2419 2421 */ 2420 2422 function get_next_comments_link( $label = '', $max_page = 0 ) { 2421 2423 global $wp_query; … … 2467 2469 * @since 2.7.1 2468 2470 * 2469 2471 * @param string $label Optional. Label for comments link text. 2470 * @return string|null 2472 * @return string|null HTML-formatted link for the previous page of comments. 2471 2473 */ 2472 2474 function get_previous_comments_link( $label = '' ) { 2473 2475 if ( !is_singular() || !get_option('page_comments') ) … … 2550 2552 * 2551 2553 * @since 2.6.0 2552 2554 * 2553 * @return string 2555 * @return string The Press This bookmarklet link URL. 2554 2556 */ 2555 2557 function get_shortcut_link() { 2556 2558 // In case of breaking changes, version this. #WP20071