Changeset 9136
- Timestamp:
- 10/13/2008 10:00:07 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/link-template.php
r9097 r9136 1 1 <?php 2 3 2 /** 3 * WordPress Link Template Functions 4 * 5 * @package WordPress 6 * @subpackage Template 7 */ 8 9 /** 10 * {@internal Missing Short Description}} 11 * 12 * {@internal Missing Long Description}} 13 * 14 * @since 1.2.0 15 * @uses apply_filters() 16 */ 4 17 function the_permalink() { 5 18 echo apply_filters('the_permalink', get_permalink()); 6 19 } 7 20 8 9 /** 21 /** 22 * {@internal Missing Short Description}} 23 * 10 24 * Conditionally adds a trailing slash if the permalink structure 11 25 * has a trailing slash, strips the trailing slash if not 12 * @global object Uses $wp_rewrite 26 * {@internal Missing Long Description}} 27 * 28 * @since 2.2.0 29 * @uses $wp_rewrite 30 * 13 31 * @param $string string a URL with or without a trailing slash 14 32 * @param $type_of_url string the type of URL being considered (e.g. single, category, etc) for use in the filter … … 28 46 } 29 47 30 48 /** 49 * {@internal Missing Short Description}} 50 * 51 * {@internal Missing Long Description}} 52 * 53 * @since 0.71 54 * 55 * @param unknown_type $mode 56 */ 31 57 function permalink_anchor($mode = 'id') { 32 58 global $post; … … 43 69 } 44 70 45 71 /** 72 * {@internal Missing Short Description}} 73 * 74 * {@internal Missing Long Description}} 75 * 76 * @since 1.0.0 77 * 78 * @param unknown_type $id 79 * @return unknown 80 */ 46 81 function get_permalink($id = 0, $leavename=false) { 47 82 $rewritecode = array( … … 120 155 } 121 156 122 // get permalink from post ID 157 /** 158 * Retrieve permalink from post ID. 159 * 160 * {@internal Missing Long Description}} 161 * 162 * @since 1.0.0 163 * 164 * @param unknown_type $post_id 165 * @param unknown_type $deprecated 166 * @return unknown 167 */ 123 168 function post_permalink($post_id = 0, $deprecated = '') { 124 169 return get_permalink($post_id); … … 126 171 127 172 // Respects page_on_front. Use this one. 173 /** 174 * {@internal Missing Short Description}} 175 * 176 * {@internal Missing Long Description}} 177 * 178 * @since 1.5.0 179 * 180 * @param unknown_type $id 181 * @return unknown 182 */ 128 183 function get_page_link($id = false, $leavename = false) { 129 184 global $post; … … 141 196 } 142 197 143 // Ignores page_on_front. Internal use only. 198 /** 199 * {@internal Missing Short Description}} 200 * 201 * {@internal Missing Long Description}} 202 * 203 * Ignores page_on_front. Internal use only. 204 * 205 * @since 2.1.0 206 * @access private 207 * 208 * @param unknown_type $id 209 * @return unknown 210 */ 144 211 function _get_page_link( $id = false, $leavename = false ) { 145 212 global $post, $wp_rewrite; … … 164 231 } 165 232 233 /** 234 * {@internal Missing Short Description}} 235 * 236 * {@internal Missing Long Description}} 237 * 238 * @since 2.0.0 239 * 240 * @param unknown_type $id 241 * @return unknown 242 */ 166 243 function get_attachment_link($id = false) { 167 244 global $post, $wp_rewrite; … … 195 272 } 196 273 274 /** 275 * {@internal Missing Short Description}} 276 * 277 * {@internal Missing Long Description}} 278 * 279 * @since 1.5.0 280 * 281 * @param unknown_type $year 282 * @return unknown 283 */ 197 284 function get_year_link($year) { 198 285 global $wp_rewrite; … … 208 295 } 209 296 297 /** 298 * {@internal Missing Short Description}} 299 * 300 * {@internal Missing Long Description}} 301 * 302 * @since 1.0.0 303 * 304 * @param unknown_type $year 305 * @param unknown_type $month 306 * @return unknown 307 */ 210 308 function get_month_link($year, $month) { 211 309 global $wp_rewrite; … … 224 322 } 225 323 324 /** 325 * {@internal Missing Short Description}} 326 * 327 * {@internal Missing Long Description}} 328 * 329 * @since 1.0.0 330 * 331 * @param unknown_type $year 332 * @param unknown_type $month 333 * @param unknown_type $day 334 * @return unknown 335 */ 226 336 function get_day_link($year, $month, $day) { 227 337 global $wp_rewrite; … … 244 354 } 245 355 356 /** 357 * {@internal Missing Short Description}} 358 * 359 * {@internal Missing Long Description}} 360 * 361 * @since 1.5.0 362 * 363 * @param unknown_type $feed 364 * @return unknown 365 */ 246 366 function get_feed_link($feed = '') { 247 367 global $wp_rewrite; … … 273 393 } 274 394 395 /** 396 * {@internal Missing Short Description}} 397 * 398 * {@internal Missing Long Description}} 399 * 400 * @since 2.2.0 401 * 402 * @param unknown_type $post_id 403 * @param unknown_type $feed 404 * @return unknown 405 */ 275 406 function get_post_comments_feed_link($post_id = '', $feed = '') { 276 407 global $id; … … 298 429 } 299 430 300 /** post_comments_feed_link() - Output the comment feed link for a post. 301 * 302 * Prints out the comment feed link for a post. Link text is placed in the 303 * anchor. If no link text is specified, default text is used. If no post ID 304 * is specified, the current post is used. 431 /** 432 * Display the comment feed link for a post. 433 * 434 * Prints out the comment feed link for a post. Link text is placed in the 435 * anchor. If no link text is specified, default text is used. If no post ID is 436 * specified, the current post is used. 305 437 * 306 438 * @package WordPress 307 439 * @subpackage Feed 308 * @since 2.5 309 * 310 * @param string Descriptive text 311 * @param int Optional post ID. Default to current post. 440 * @since 2.5.0 441 * 442 * @param string $link_text Descriptive text 443 * @param int $post_id Optional post ID. Default to current post. 444 * @param string $feed Optional. {@internal Missing Description}} 312 445 * @return string Link to the comment feed for the current post 313 446 */ … … 320 453 } 321 454 322 /** Get the feed link for a given author 323 * 324 * Returns a link to the feed for all posts by a given author. A specific feed can be requested 325 * or left blank to get the default feed. 455 /** 456 * Retrieve the feed link for a given author. 457 * 458 * Returns a link to the feed for all posts by a given author. A specific feed 459 * can be requested or left blank to get the default feed. 326 460 * 327 461 * @package WordPress 328 462 * @subpackage Feed 329 * @since 2.5 330 * 331 * @param int $author_id ID of an author 332 * @param string $feed Feed type 333 * @return string Link to the feed for the author specified by $author_id 463 * @since 2.5.0 464 * 465 * @param int $author_id ID of an author. 466 * @param string $feed Feed type. 467 * @return string Link to the feed for the author specified by $author_id. 334 468 */ 335 469 function get_author_feed_link( $author_id, $feed = '' ) { … … 357 491 } 358 492 359 /** Get the feed link for a given category 360 * 361 * Returns a link to the feed for all posts in a given category. A specific feed can be requested 362 * or left blank to get the default feed. 493 /** 494 * Retrieve the feed link for a category. 495 * 496 * Returns a link to the feed for all post in a given category. A specific feed 497 * can be requested or left blank to get the default feed. 363 498 * 364 499 * @package WordPress 365 500 * @subpackage Feed 366 * @since 2.5 367 * 368 * @param int $cat_id ID of a category 369 * @param string $feed Feed type 370 * @return string Link to the feed for the category specified by $cat_id 501 * @since 2.5.0 502 * 503 * @param int $cat_id ID of a category. 504 * @param string $feed Feed type. 505 * @return string Link to the feed for the category specified by $cat_id. 371 506 */ 372 507 function get_category_feed_link($cat_id, $feed = '') { … … 400 535 } 401 536 537 /** 538 * {@internal Missing Short Description}} 539 * 540 * {@internal Missing Long Description}} 541 * 542 * @since 2.3.0 543 * 544 * @param unknown_type $tag_id 545 * @param unknown_type $feed 546 * @return unknown 547 */ 402 548 function get_tag_feed_link($tag_id, $feed = '') { 403 549 $tag_id = (int) $tag_id; … … 429 575 } 430 576 577 /** 578 * {@internal Missing Short Description}} 579 * 580 * {@internal Missing Long Description}} 581 * 582 * @since 2.5.0 583 * 584 * @param unknown_type $search_query 585 * @param unknown_type $feed 586 * @return unknown 587 */ 431 588 function get_search_feed_link($search_query = '', $feed = '') { 432 589 if ( empty($search_query) ) … … 445 602 } 446 603 604 /** 605 * {@internal Missing Short Description}} 606 * 607 * {@internal Missing Long Description}} 608 * 609 * @since 2.5.0 610 * 611 * @param unknown_type $search_query 612 * @param unknown_type $feed 613 * @return unknown 614 */ 447 615 function get_search_comments_feed_link($search_query = '', $feed = '') { 448 616 if ( empty($search_query) ) … … 461 629 } 462 630 631 /** 632 * {@internal Missing Short Description}} 633 * 634 * {@internal Missing Long Description}} 635 * 636 * @since 2.3.0 637 * 638 * @param unknown_type $id 639 * @return unknown 640 */ 463 641 function get_edit_post_link( $id = 0, $context = 'display' ) { 464 642 if ( !$post = &get_post( $id ) ) … … 501 679 } 502 680 681 /** 682 * {@internal Missing Short Description}} 683 * 684 * {@internal Missing Long Description}} 685 * 686 * @since 1.0.0 687 * 688 * @param unknown_type $link 689 * @param unknown_type $before 690 * @param unknown_type $after 691 */ 503 692 function edit_post_link( $link = 'Edit This', $before = '', $after = '' ) { 504 693 global $post; … … 516 705 } 517 706 707 /** 708 * {@internal Missing Short Description}} 709 * 710 * {@internal Missing Long Description}} 711 * 712 * @since 2.3.0 713 * 714 * @param unknown_type $comment_id 715 * @return unknown 716 */ 518 717 function get_edit_comment_link( $comment_id = 0 ) { 519 718 $comment = &get_comment( $comment_id ); … … 532 731 } 533 732 733 /** 734 * {@internal Missing Short Description}} 735 * 736 * {@internal Missing Long Description}} 737 * 738 * @since 1.0.0 739 * 740 * @param unknown_type $link 741 * @param unknown_type $before 742 * @param unknown_type $after 743 */ 534 744 function edit_comment_link( $link = 'Edit This', $before = '', $after = '', $echo = true ) { 535 745 global $comment, $post; … … 552 762 } 553 763 764 /** 765 * {@internal Missing Short Description}} 766 * 767 * {@internal Missing Long Description}} 768 * 769 * @since unknown 770 * 771 * @param unknown_type $link 772 * @return unknown 773 */ 554 774 function get_edit_bookmark_link( $link = 0 ) { 555 775 $link = &get_bookmark( $link ); … … 562 782 } 563 783 784 /** 785 * {@internal Missing Short Description}} 786 * 787 * {@internal Missing Long Description}} 788 * 789 * @since unknown 790 * 791 * @param unknown_type $link 792 * @param unknown_type $before 793 * @param unknown_type $after 794 * @param unknown_type $bookmark 795 */ 564 796 function edit_bookmark_link( $link = '', $before = '', $after = '', $bookmark = null ) { 565 797 $bookmark = get_bookmark($bookmark); … … 577 809 // Navigation links 578 810 811 /** 812 * {@internal Missing Short Description}} 813 * 814 * {@internal Missing Long Description}} 815 * 816 * @since 1.5.0 817 * 818 * @param unknown_type $in_same_cat 819 * @param unknown_type $excluded_categories 820 * @return unknown 821 */ 579 822 function get_previous_post($in_same_cat = false, $excluded_categories = '') { 580 823 return get_adjacent_post($in_same_cat, $excluded_categories); 581 824 } 582 825 826 /** 827 * {@internal Missing Short Description}} 828 * 829 * {@internal Missing Long Description}} 830 * 831 * @since 1.5.0 832 * 833 * @param unknown_type $in_same_cat 834 * @param unknown_type $excluded_categories 835 * @return unknown 836 */ 583 837 function get_next_post($in_same_cat = false, $excluded_categories = '') { 584 838 return get_adjacent_post($in_same_cat, $excluded_categories, false); 585 839 } 586 840 841 /** 842 * {@internal Missing Short Description}} 843 * 844 * {@internal Missing Long Description}} 845 * 846 * @since 2.5.0 847 * 848 * @param unknown_type $in_same_cat 849 * @param unknown_type $excluded_categories 850 * @param unknown_type $previous 851 * @return unknown 852 */ 587 853 function get_adjacent_post($in_same_cat = false, $excluded_categories = '', $previous = true) { 588 854 global $post, $wpdb; … … 628 894 } 629 895 896 /** 897 * {@internal Missing Short Description}} 898 * 899 * {@internal Missing Long Description}} 900 * 901 * @since 1.5.0 902 * 903 * @param unknown_type $format 904 * @param unknown_type $link 905 * @param unknown_type $in_same_cat 906 * @param unknown_type $excluded_categories 907 */ 630 908 function previous_post_link($format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '') { 631 909 adjacent_post_link($format, $link, $in_same_cat, $excluded_categories, true); 632 910 } 633 911 912 /** 913 * {@internal Missing Short Description}} 914 * 915 * {@internal Missing Long Description}} 916 * 917 * @since 1.5.0 918 * 919 * @param unknown_type $format 920 * @param unknown_type $link 921 * @param unknown_type $in_same_cat 922 * @param unknown_type $excluded_categories 923 */ 634 924 function next_post_link($format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '') { 635 925 adjacent_post_link($format, $link, $in_same_cat, $excluded_categories, false); 636 926 } 637 927 928 /** 929 * {@internal Missing Short Description}} 930 * 931 * {@internal Missing Long Description}} 932 * 933 * @since 2.5.0 934 * 935 * @param unknown_type $format 936 * @param unknown_type $link 937 * @param unknown_type $in_same_cat 938 * @param unknown_type $excluded_categories 939 * @param unknown_type $previous 940 */ 638 941 function adjacent_post_link($format, $link, $in_same_cat = false, $excluded_categories = '', $previous = true) { 639 942 if ( $previous && is_attachment() ) … … 664 967 } 665 968 969 /** 970 * {@internal Missing Short Description}} 971 * 972 * {@internal Missing Long Description}} 973 * 974 * @since 1.5.0 975 * 976 * @param unknown_type $pagenum 977 * @return unknown 978 */ 666 979 function get_pagenum_link($pagenum = 1) { 667 980 global $wp_rewrite; … … 718 1031 } 719 1032 1033 /** 1034 * {@internal Missing Short Description}} 1035 * 1036 * {@internal Missing Long Description}} 1037 * Backported from 2.1.3 to 2.0.10. 1038 * 1039 * @since 2.0.10 1040 * 1041 * @param unknown_type $max_page 1042 * @return unknown 1043 */ 720 1044 function get_next_posts_page_link($max_page = 0) { 721 1045 global $paged; … … 730 1054 } 731 1055 1056 /** 1057 * {@internal Missing Short Description}} 1058 * 1059 * {@internal Missing Long Description}} 1060 * 1061 * @since 0.71 1062 * 1063 * @param unknown_type $max_page 1064 */ 732 1065 function next_posts($max_page = 0) { 733 1066 echo clean_url(get_next_posts_page_link($max_page)); 734 1067 } 735 1068 1069 /** 1070 * {@internal Missing Short Description}} 1071 * 1072 * {@internal Missing Long Description}} 1073 * 1074 * @since 0.71 1075 * 1076 * @param unknown_type $label 1077 * @param unknown_type $max_page 1078 */ 736 1079 function next_posts_link($label='Next Page »', $max_page=0) { 737 1080 global $paged, $wp_query; … … 750 1093 } 751 1094 1095 /** 1096 * {@internal Missing Short Description}} 1097 * 1098 * {@internal Missing Long Description}} 1099 * 1100 * @since 2.0.10 Backported 1101 * @since 2.1.3 1102 * 1103 * @return unknown 1104 */ 752 1105 function get_previous_posts_page_link() { 753 1106 global $paged; … … 761 1114 } 762 1115 1116 /** 1117 * {@internal Missing Short Description}} 1118 * 1119 * {@internal Missing Long Description}} 1120 * 1121 * @since 0.71 1122 * 1123 */ 763 1124 function previous_posts() { 764 1125 echo clean_url(get_previous_posts_page_link()); 765 1126 } 766 1127 1128 /** 1129 * {@internal Missing Short Description}} 1130 * 1131 * {@internal Missing Long Description}} 1132 * 1133 * @since 0.71 1134 * 1135 * @param unknown_type $label 1136 */ 767 1137 function previous_posts_link($label='« Previous Page') { 768 1138 global $paged; … … 775 1145 } 776 1146 1147 /** 1148 * {@internal Missing Short Description}} 1149 * 1150 * {@internal Missing Long Description}} 1151 * 1152 * @since 0.71 1153 * 1154 * @param unknown_type $sep 1155 * @param unknown_type $prelabel 1156 * @param unknown_type $nxtlabel 1157 */ 777 1158 function posts_nav_link($sep=' — ', $prelabel='« Previous Page', $nxtlabel='Next Page »') { 778 1159 global $wp_query; … … 910 1291 } 911 1292 1293 /** 1294 * {@internal Missing Short Description}} 1295 * 1296 * {@internal Missing Long Description}} 1297 * 1298 * @since unknown 1299 * 1300 * @return unknown 1301 */ 912 1302 function get_shortcut_link() { 913 1303 $link = "javascript: … … 939 1329 } 940 1330 941 /** Return the site url942 * 943 * 944 * @package WordPress945 * @since 2.6946 * 947 * Returns the 'site_url' option with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise.948 * If $scheme is 'http' or 'https', is_ssl() is overridden.949 * 950 * @param string $path Optional path relative to the site url951 * @param string $scheme Optional scheme to give the site url context. Currently 'http','https', 'login', 'login_post', or 'admin'952 * @return string Site url link with optional path appended 1331 /** 1332 * Retrieve the site url. 1333 * 1334 * Returns the 'site_url' option with the appropriate protocol, 'https' if 1335 * is_ssl() and 'http' otherwise. If $scheme is 'http' or 'https', is_ssl() is 1336 * overridden. 1337 * 1338 * @since 2.6.0 1339 * 1340 * @param string $path Optional. Path relative to the site url. 1341 * @param string $scheme Optional. Scheme to give the site url context. Currently 'http','https', 'login', 'login_post', or 'admin'. 1342 * @return string Site url link with optional path appended. 953 1343 */ 954 1344 function site_url($path = '', $scheme = null) { … … 974 1364 } 975 1365 976 /** Return the admin url977 * 1366 /** 1367 * Retrieve the url to the admin area. 978 1368 * 979 1369 * @package WordPress 980 * @since 2.6 981 * 982 * Returns the url to the admin area 1370 * @since 2.6.0 983 1371 * 984 1372 * @param string $path Optional path relative to the admin url … … 994 1382 } 995 1383 996 /** Return the includes url997 * 1384 /** 1385 * Retrieve the url to the includes directory. 998 1386 * 999 1387 * @package WordPress 1000 * @since 2.6 1001 * 1002 * Returns the url to the includes directory 1003 * 1004 * @param string $path Optional path relative to the includes url 1005 * @return string Includes url link with optional path appended 1388 * @since 2.6.0 1389 * 1390 * @param string $path Optional. Path relative to the includes url. 1391 * @return string Includes url link with optional path appended. 1006 1392 */ 1007 1393 function includes_url($path = '') { … … 1014 1400 } 1015 1401 1016 /** Return the content url1017 * 1402 /** 1403 * Retrieve the url to the content directory. 1018 1404 * 1019 1405 * @package WordPress 1020 * @since 2.6 1021 * 1022 * Returns the url to the content directory 1023 * 1024 * @param string $path Optional path relative to the content url 1025 * @return string Content url link with optional path appended 1406 * @since 2.6.0 1407 * 1408 * @param string $path Optional. Path relative to the content url. 1409 * @return string Content url link with optional path appended. 1026 1410 */ 1027 1411 function content_url($path = '') { … … 1039 1423 } 1040 1424 1041 /** Return the plugins url1042 * 1425 /** 1426 * Retrieve the url to the plugins directory. 1043 1427 * 1044 1428 * @package WordPress 1045 * @since 2.6 1046 * 1047 * Returns the url to the plugins directory 1048 * 1049 * @param string $path Optional path relative to the plugins url 1050 * @return string Plugins url link with optional path appended 1429 * @since 2.6.0 1430 * 1431 * @param string $path Optional. Path relative to the plugins url. 1432 * @return string Plugins url link with optional path appended. 1051 1433 */ 1052 1434 function plugins_url($path = '') {
Note: See TracChangeset
for help on using the changeset viewer.