Changeset 37252
- Timestamp:
- 04/19/2016 11:20:32 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r37215 r37252 40 40 * @global WP_Rewrite $wp_rewrite 41 41 * 42 * @param string $string URL with or without a trailing slash. 43 * @param string $type_of_url The type of URL being considered (e.g. single, category, etc) for use in the filter. 42 * @param string $string URL with or without a trailing slash. 43 * @param string $type_of_url Optional. The type of URL being considered (e.g. single, category, etc) 44 * for use in the filter. Default empty string. 44 45 * @return string The URL with the trailing slash appended or stripped. 45 46 */ … … 72 73 * @since 0.71 73 74 * 74 * @param string $mode Permalink mode can be either 'title', 'id', or default, which is'id'.75 * @param string $mode Optional. Permalink mode. Accepts 'title' or 'id'. Default 'id'. 75 76 */ 76 77 function permalink_anchor( $mode = 'id' ) { … … 243 244 * @global WP_Rewrite $wp_rewrite 244 245 * 245 * @param int $id Optional. Post ID. 246 * @param bool $leavename Optional, defaults to false. Whether to keep post name. 247 * @param bool $sample Optional, defaults to false. Is it a sample permalink. 246 * @param int $id Optional. Post ID. Default uses the global `$post`. 247 * @param bool $leavename Optional, defaults to false. Whether to keep post name. Default false. 248 * @param bool $sample Optional, defaults to false. Is it a sample permalink. Default false. 248 249 * @return string|WP_Error The post permalink. 249 250 */ … … 301 302 * @since 1.5.0 302 303 * 303 * @param int|object $post Optional. Post ID or object. 304 * @param bool $leavename Optional, defaults to false. Whether to keep page name. 305 * @param bool $sample Optional, defaults to false. Is it a sample permalink. 304 * @param int|WP_Post $post Optional. Post ID or object. Default uses the global `$post`. 305 * @param bool $leavename Optional. Whether to keep the page name. Default false. 306 * @param bool $sample Optional. Whether it should be treated as a sample permalink. 307 * Default false. 306 308 * @return string The page permalink. 307 309 */ … … 336 338 * @global WP_Rewrite $wp_rewrite 337 339 * 338 * @param int|object $post Optional. Post ID or object. 339 * @param bool $leavename Optional. Leave name. 340 * @param bool $sample Optional. Sample permalink. 340 * @param int|WP_Post $post Optional. Post ID or object. Default uses the global `$post`. 341 * @param bool $leavename Optional. Whether to keep the page name. Default false. 342 * @param bool $sample Optional. Whether it should be treated as a sample permalink. 343 * Default false. 341 344 * @return string The page permalink. 342 345 */ … … 381 384 * @global WP_Rewrite $wp_rewrite 382 385 * 383 * @param int|object $post Optional. Post ID or object. 384 * @param bool $leavename Optional. Leave name.386 * @param int|object $post Optional. Post ID or object. Default uses the global `$post`. 387 * @param bool $leavename Optional. Whether to keep the page name. Default false. 385 388 * @return string The attachment permalink. 386 389 */ … … 440 443 * @return string The permalink for the specified year archive. 441 444 */ 442 function get_year_link( $year) {445 function get_year_link( $year ) { 443 446 global $wp_rewrite; 444 447 if ( !$year ) … … 551 554 * 552 555 * @param string $anchor The link's anchor text. 553 * @param string $feed Optional , defaults to default feed. Feed type.556 * @param string $feed Optional. Feed type. Default empty. 554 557 */ 555 558 function the_feed_link( $anchor, $feed = '' ) { … … 575 578 * @global WP_Rewrite $wp_rewrite 576 579 * 577 * @param string $feed Optional , defaults to default feed. Feed type.580 * @param string $feed Optional. Feed type. Default empty. 578 581 * @return string The feed permalink. 579 582 */ 580 function get_feed_link( $feed = '') {583 function get_feed_link( $feed = '' ) { 581 584 global $wp_rewrite; 582 585 … … 620 623 * @since 2.2.0 621 624 * 622 * @param int $post_id Optional. Post ID. 623 * @param string $feed Optional. Feed type. 625 * @param int $post_id Optional. Post ID. Default is the ID of the global `$post`. 626 * @param string $feed Optional. Feed type. Default empty. 624 627 * @return string The permalink for the comments feed for the given post. 625 628 */ 626 function get_post_comments_feed_link( $post_id = 0, $feed = '') {629 function get_post_comments_feed_link( $post_id = 0, $feed = '' ) { 627 630 $post_id = absint( $post_id ); 628 631 … … 683 686 * @since 2.5.0 684 687 * 685 * @param string $link_text Descriptive text.686 * @param int $post_id Optional post ID. Default to current post.687 * @param string $feed Optional. Feed format. 688 * @param string $link_text Optional. Descriptive link text. Default 'Comments Feed'. 689 * @param int $post_id Optional. Post ID. Default is the ID of the global `$post`. 690 * @param string $feed Optional. Feed format. Default empty. 688 691 */ 689 692 function post_comments_feed_link( $link_text = '', $post_id = '', $feed = '' ) { … … 714 717 * @since 2.5.0 715 718 * 716 * @param int $author_id ID of an author.717 * @param string $feed Optional. Feed type. 719 * @param int $author_id Author ID. 720 * @param string $feed Optional. Feed type. Default empty. 718 721 * @return string Link to the feed for the author specified by $author_id. 719 722 */ … … 758 761 * @since 2.5.0 759 762 * 760 * @param int $cat_id ID of a category.761 * @param string $feed Optional. Feed type. 763 * @param int $cat_id Category ID. 764 * @param string $feed Optional. Feed type. Default empty. 762 765 * @return string Link to the feed for the category specified by $cat_id. 763 766 */ … … 774 777 * @since 3.0.0 775 778 * 776 * @param int $term_id ID of a category.777 * @param string $taxonomy Optional. Taxonomy of $term_id778 * @param string $feed Optional. Feed type. 779 * @param int $term_id Term ID. 780 * @param string $taxonomy Optional. Taxonomy of `$term_id`. Default 'category'. 781 * @param string $feed Optional. Feed type. Default empty. 779 782 * @return string|false Link to the feed for the term specified by $term_id and $taxonomy. 780 783 */ … … 854 857 * 855 858 * @param int $tag_id Tag ID. 856 * @param string $feed Optional. Feed type. 859 * @param string $feed Optional. Feed type. Default empty. 857 860 * @return string The feed permalink for the given tag. 858 861 */ … … 866 869 * @since 2.7.0 867 870 * 868 * @param int $tag_id Tag ID 869 * @param string $taxonomy Taxonomy871 * @param int $tag_id Tag ID. 872 * @param string $taxonomy Optional. Taxonomy slug. Default 'post_tag'. 870 873 * @return string The edit tag link URL for the given tag. 871 874 */ … … 886 889 * @since 2.7.0 887 890 * 888 * @param string $link Optional. Anchor text. 889 * @param string $before Optional. Display before edit link. 890 * @param string $after Optional. Display after edit link. 891 * @param object $tag Tag object. 891 * @param string $link Optional. Anchor text. Default empty. 892 * @param string $before Optional. Display before edit link. Default empty. 893 * @param string $after Optional. Display after edit link. Default empty. 894 * @param WP_Term $tag Optional. Term object. If null, the queried object will be inspected. 895 * Default null. 892 896 */ 893 897 function edit_tag_link( $link = '', $before = '', $after = '', $tag = null ) { … … 911 915 * 912 916 * @param int $term_id Term ID. 913 * @param string $taxonomy Optional. Taxonomy. Defaults to the taxonomy of the term identified by `$term_id`. 914 * @param string $object_type Optional. The object type. Used to highlight the proper post type menu on the linked page. 915 * Defaults to the first object_type associated with the taxonomy. 917 * @param string $taxonomy Optional. Taxonomy. Defaults to the taxonomy of the term identified 918 * by `$term_id`. 919 * @param string $object_type Optional. The object type. Used to highlight the proper post type 920 * menu on the linked page. Defaults to the first object_type associated 921 * with the taxonomy. 916 922 * @return string|null The edit term link URL for the given term, or null on failure. 917 923 */ … … 1008 1014 * @global WP_Rewrite $wp_rewrite 1009 1015 * 1010 * @param string $query Optional. The query string to use. If empty the current query is used. 1016 * @param string $query Optional. The query string to use. If empty the current query is used. Default empty. 1011 1017 * @return string The search permalink. 1012 1018 */ … … 1048 1054 * @global WP_Rewrite $wp_rewrite 1049 1055 * 1050 * @param string $search_query Optional. Search query. 1051 * @param string $feed Optional. Feed type. 1056 * @param string $search_query Optional. Search query. Default empty. 1057 * @param string $feed Optional. Feed type. Default empty. 1052 1058 * @return string The search results feed permalink. 1053 1059 */ … … 1087 1093 * @global WP_Rewrite $wp_rewrite 1088 1094 * 1089 * @param string $search_query Optional. Search query. 1090 * @param string $feed Optional. Feed type. 1095 * @param string $search_query Optional. Search query. Default empty. 1096 * @param string $feed Optional. Feed type. Default empty. 1091 1097 * @return string The comments feed search results permalink. 1092 1098 */ … … 1170 1176 * 1171 1177 * @param string $post_type Post type 1172 * @param string $feed Optional. Feed type 1178 * @param string $feed Optional. Feed type. Default empty. 1173 1179 * @return string|false The post type feed permalink. 1174 1180 */ … … 1209 1215 * @since 4.4.0 1210 1216 * 1211 * @param int|WP_Post $post Optional. Post ID or `WP_Post` object. Defaults to global post.1217 * @param int|WP_Post $post Optional. Post ID or `WP_Post` object. Defaults to global `$post`. 1212 1218 * @param array $query_args Optional. Array of additional query args to be appended to the link. 1213 * @param string $preview_link Optional. Base preview link to be used if it should differ from the post permalink. 1219 * Default empty array. 1220 * @param string $preview_link Optional. Base preview link to be used if it should differ from the 1221 * post permalink. Default empty. 1214 1222 * @return string URL used for the post preview. 1215 1223 */ … … 1403 1411 * 1404 1412 * @since 1.0.0 1405 * @since 4.6.0 The `$comment` and `$class` arguments were added. 1406 * 1407 * @param string $text Optional. Anchor text. 1408 * @param string $before Optional. Display before edit link. 1409 * @param string $after Optional. Display after edit link. 1410 * @param int|WP_Comment $comment Optional. Comment ID or WP_Comment object. 1411 * @param string $class Optional. Add custom class to link. 1412 */ 1413 function edit_comment_link( $text = null, $before = '', $after = '', $comment = 0, $class = 'comment-edit-link' ) { 1414 $comment = get_comment( $comment ); 1413 * 1414 * @param string $text Optional. Anchor text. 1415 * @param string $before Optional. Display before edit link. 1416 * @param string $after Optional. Display after edit link. 1417 */ 1418 function edit_comment_link( $text = null, $before = '', $after = '' ) { 1419 $comment = get_comment(); 1415 1420 1416 1421 if ( ! current_user_can( 'edit_comment', $comment->comment_ID ) ) { … … 1422 1427 } 1423 1428 1424 $link = '<a class=" ' . esc_attr( $class ) . '" href="' . esc_url( get_edit_comment_link( $comment ) ) . '">' . $text . '</a>';1429 $link = '<a class="comment-edit-link" href="' . esc_url( get_edit_comment_link( $comment ) ) . '">' . $text . '</a>'; 1425 1430 1426 1431 /**
Note: See TracChangeset
for help on using the changeset viewer.