Changeset 8822
- Timestamp:
- 09/05/2008 07:19:01 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/general-template.php
r8784 r8822 1 1 <?php 2 3 /* Note: these tags go anywhere in the template */ 4 2 /** 3 * General template tags that can go anywhere in a template. 4 * 5 * @package WordPress 6 * @subpackage Template 7 */ 8 9 /** 10 * Load template header or named header file. 11 * 12 * {@internal Missing Long Description}} 13 * 14 * @uses locate_template() 15 * @since 1.5.0 16 * @uses do_action() Calls 'get_header' action. 17 */ 5 18 function get_header( $name = null ) { 6 19 do_action( 'get_header' ); … … 16 29 } 17 30 18 31 /** 32 * get_footer() - {@internal Missing Short Description}} 33 * 34 * {@internal Missing Long Description}} 35 * 36 * @since 1.5.0 37 * @uses do_action() 38 */ 19 39 function get_footer( $name = null ) { 20 40 do_action( 'get_footer' ); … … 30 50 } 31 51 32 52 /** 53 * get_sidebar() - {@internal Missing Short Description}} 54 * 55 * {@internal Missing Long Description}} 56 * 57 * @since 1.5.0 58 * @uses do_action() 59 */ 33 60 function get_sidebar( $name = null ) { 34 61 do_action( 'get_sidebar' ); … … 44 71 } 45 72 46 73 /** 74 * wp_loginout() - {@internal Missing Short Description}} 75 * 76 * {@internal Missing Long Description}} 77 * 78 * @since 1.5.0 79 * @uses apply_filters() 80 */ 47 81 function wp_loginout() { 48 82 if ( ! is_user_logged_in() ) … … 54 88 } 55 89 56 90 /** 91 * wp_register() - {@internal Missing Short Description}} 92 * 93 * {@internal Missing Long Description}} 94 * 95 * @since 1.5.0 96 * @uses apply_filters() 97 * 98 * @param unknown_type $before 99 * @param unknown_type $after 100 */ 57 101 function wp_register( $before = '<li>', $after = '</li>' ) { 58 102 … … 69 113 } 70 114 71 115 /** 116 * Theme container function for the 'wp_meta' action. 117 * 118 * The 'wp_meta' action can have several purposes, depending on how you use it, 119 * but one purpose might have been to allow for theme switching. 120 * 121 * @since 1.5.0 122 * @link http://trac.wordpress.org/ticket/1458 Explaination of 'wp_meta' action. 123 * @uses do_action() Calls 'wp_meta' hook. 124 */ 72 125 function wp_meta() { 73 126 do_action('wp_meta'); 74 127 } 75 128 76 129 /** 130 * bloginfo() - {@internal Missing Short Description}} 131 * 132 * {@internal Missing Long Description}} 133 * 134 * @since 0.71 135 * 136 * @param unknown_type $show 137 */ 77 138 function bloginfo($show='') { 78 139 echo get_bloginfo($show, 'display'); … … 80 141 81 142 /** 143 * get_bloginfo() - {@internal Missing Short Description}} 144 * 145 * {@internal Missing Long Description}} 146 * 82 147 * Note: some of these values are DEPRECATED. Meaning they could be 83 148 * taken out at any time and shouldn't be relied upon. Options 84 149 * without "// DEPRECATED" are the preferred and recommended ways 85 150 * to get the information. 151 * 152 * @since 0.71 153 * 154 * @param unknown_type $show 155 * @param unknown_type $filter 156 * @return unknown 86 157 */ 87 158 function get_bloginfo($show = '', $filter = 'raw') { … … 174 245 } 175 246 176 247 /** 248 * wp_title() - {@internal Missing Short Description}} 249 * 250 * {@internal Missing Long Description}} 251 * 252 * @since 1.0.0 253 * 254 * @param unknown_type $sep 255 * @param unknown_type $display 256 * @return unknown 257 */ 177 258 function wp_title($sep = '»', $display = true, $seplocation = '') { 178 259 global $wpdb, $wp_locale, $wp_query; … … 280 361 } 281 362 282 363 /** 364 * single_post_title() - {@internal Missing Short Description}} 365 * 366 * {@internal Missing Long Description}} 367 * 368 * @since 0.71 369 * @uses $wpdb 370 * 371 * @param unknown_type $prefix 372 * @param unknown_type $display 373 * @return unknown 374 */ 283 375 function single_post_title($prefix = '', $display = true) { 284 376 global $wpdb; … … 299 391 } 300 392 301 393 /** 394 * single_cat_title() - {@internal Missing Short Description}} 395 * 396 * {@internal Missing Long Description}} 397 * 398 * @since 0.71 399 * 400 * @param unknown_type $prefix 401 * @param unknown_type $display 402 * @return unknown 403 */ 302 404 function single_cat_title($prefix = '', $display = true ) { 303 405 $cat = intval( get_query_var('cat') ); … … 315 417 } 316 418 317 419 /** 420 * single_tag_title() - {@internal Missing Short Description}} 421 * 422 * {@internal Missing Long Description}} 423 * 424 * @since 2.3.0 425 * 426 * @param unknown_type $prefix 427 * @param unknown_type $display 428 * @return unknown 429 */ 318 430 function single_tag_title($prefix = '', $display = true ) { 319 431 if ( !is_tag() ) … … 336 448 } 337 449 338 450 /** 451 * single_month_title() - {@internal Missing Short Description}} 452 * 453 * {@internal Missing Long Description}} 454 * 455 * @since 0.71 456 * 457 * @param unknown_type $prefix 458 * @param unknown_type $display 459 * @return unknown 460 */ 339 461 function single_month_title($prefix = '', $display = true ) { 340 462 global $wp_locale; … … 362 484 } 363 485 364 365 /* link navigation hack by Orien http://icecode.com/ */ 486 /** 487 * get_archives_link() - {@internal Missing Short Description}} 488 * 489 * {@internal Missing Long Description}} 490 * 491 * @since 1.0.0 492 * @author Orien 493 * @link http://icecode.com/ link navigation hack by Orien 494 * 495 * @param unknown_type $url 496 * @param unknown_type $text 497 * @param unknown_type $format 498 * @param unknown_type $before 499 * @param unknown_type $after 500 * @return unknown 501 */ 366 502 function get_archives_link($url, $text, $format = 'html', $before = '', $after = '') { 367 503 $text = wptexturize($text); … … 383 519 } 384 520 385 521 /** 522 * wp_get_archives() - {@internal Missing Short Description}} 523 * 524 * {@internal Missing Long Description}} 525 * 526 * @since 1.2.0 527 * 528 * @param unknown_type $args 529 */ 386 530 function wp_get_archives($args = '') { 387 531 global $wpdb, $wp_locale; … … 549 693 } 550 694 551 552 // Used in get_calendar 695 /** 696 * calendar_week_mod() - {@internal Missing Short Description}} 697 * 698 * {@internal Missing Long Description}} 699 * 700 * @since 1.5.0 701 * @usedby get_calendar() 702 * 703 * @param unknown_type $num 704 * @return unknown 705 */ 553 706 function calendar_week_mod($num) { 554 707 $base = 7; … … 556 709 } 557 710 558 711 /** 712 * get_calendar() - {@internal Missing Short Description}} 713 * 714 * {@internal Missing Long Description}} 715 * 716 * @since 1.0.0 717 * 718 * @param unknown_type $initial 719 */ 559 720 function get_calendar($initial = true) { 560 721 global $wpdb, $m, $monthnum, $year, $wp_locale, $posts; … … 749 910 } 750 911 912 /** 913 * delete_get_calendar_cache() - {@internal Missing Short Description}} 914 * 915 * @since 2.1.0 916 */ 751 917 function delete_get_calendar_cache() { 752 918 wp_cache_delete( 'get_calendar', 'calendar' ); … … 758 924 add_action( 'update_option_start_of_week', 'delete_get_calendar_cache' ); 759 925 760 926 /** 927 * allowed_tags() - {@internal Missing Short Description}} 928 * 929 * {@internal Missing Long Description}} 930 * 931 * @since 1.0.1 932 * @uses $allowedtags 933 * 934 * @return unknown 935 */ 761 936 function allowed_tags() { 762 937 global $allowedtags; … … 774 949 } 775 950 776 777 951 /***** Date/Time tags *****/ 778 952 779 953 /** 954 * the_date_xml() - {@internal Missing Short Description}} 955 * 956 * {@internal Missing Long Description}} 957 * 958 * @since 1.0.0 959 * 960 */ 780 961 function the_date_xml() { 781 962 global $post; … … 784 965 } 785 966 786 967 /** 968 * the_date() - {@internal Missing Short Description}} 969 * 970 * {@internal Missing Long Description}} 971 * 972 * @since 0.71 973 * 974 * @param unknown_type $d 975 * @param unknown_type $before 976 * @param unknown_type $after 977 * @param unknown_type $echo 978 * @return unknown 979 */ 787 980 function the_date($d='', $before='', $after='', $echo = true) { 788 981 global $post, $day, $previousday; … … 804 997 } 805 998 806 999 /** 1000 * the_modified_date() - {@internal Missing Short Description}} 1001 * 1002 * {@internal Missing Long Description}} 1003 * 1004 * @since 2.1.0 1005 * 1006 * @param unknown_type $d 1007 */ 807 1008 function the_modified_date($d = '') { 808 1009 echo apply_filters('the_modified_date', get_the_modified_date($d), $d); 809 1010 } 810 1011 811 1012 /** 1013 * get_the_modified_date() - {@internal Missing Short Description}} 1014 * 1015 * {@internal Missing Long Description}} 1016 * 1017 * @since 2.1.0 1018 * 1019 * @param unknown_type $d 1020 * @return unknown 1021 */ 812 1022 function get_the_modified_date($d = '') { 813 1023 if ( '' == $d ) … … 818 1028 } 819 1029 820 1030 /** 1031 * the_time() - {@internal Missing Short Description}} 1032 * 1033 * {@internal Missing Long Description}} 1034 * 1035 * @since 0.71 1036 * 1037 * @param unknown_type $d 1038 */ 821 1039 function the_time( $d = '' ) { 822 1040 echo apply_filters('the_time', get_the_time( $d ), $d); 823 1041 } 824 1042 825 1043 /** 1044 * get_the_time() - {@internal Missing Short Description}} 1045 * 1046 * {@internal Missing Long Description}} 1047 * 1048 * @since 1.5.0 1049 * 1050 * @param unknown_type $d 1051 * @return unknown 1052 */ 826 1053 function get_the_time( $d = '' ) { 827 1054 if ( '' == $d ) … … 832 1059 } 833 1060 834 1061 /** 1062 * get_post_time() - {@internal Missing Short Description}} 1063 * 1064 * {@internal Missing Long Description}} 1065 * 1066 * @since 1.5.0 1067 * 1068 * @param unknown_type $d 1069 * @param unknown_type $gmt 1070 * @return unknown 1071 */ 835 1072 function get_post_time( $d = 'U', $gmt = false ) { // returns timestamp 836 1073 global $post; … … 844 1081 } 845 1082 846 1083 /** 1084 * the_modified_time() - {@internal Missing Short Description}} 1085 * 1086 * {@internal Missing Long Description}} 1087 * 1088 * @since 2.0.0 1089 * 1090 * @param unknown_type $d 1091 */ 847 1092 function the_modified_time($d = '') { 848 1093 echo apply_filters('the_modified_time', get_the_modified_time($d), $d); 849 1094 } 850 1095 851 1096 /** 1097 * get_the_modified_time() - {@internal Missing Short Description}} 1098 * 1099 * {@internal Missing Long Description}} 1100 * 1101 * @since 2.0.0 1102 * 1103 * @param unknown_type $d 1104 * @return unknown 1105 */ 852 1106 function get_the_modified_time($d = '') { 853 1107 if ( '' == $d ) … … 858 1112 } 859 1113 860 1114 /** 1115 * get_post_modified_time() - {@internal Missing Short Description}} 1116 * 1117 * {@internal Missing Long Description}} 1118 * 1119 * @since 2.0.0 1120 * 1121 * @param unknown_type $d 1122 * @param unknown_type $gmt 1123 * @return unknown 1124 */ 861 1125 function get_post_modified_time( $d = 'U', $gmt = false ) { // returns timestamp 862 1126 global $post; … … 871 1135 } 872 1136 873 1137 /** 1138 * the_weekday() - {@internal Missing Short Description}} 1139 * 1140 * {@internal Missing Long Description}} 1141 * 1142 * @since 0.71 1143 * @uses $wp_locale 1144 * @uses $post 1145 */ 874 1146 function the_weekday() { 875 1147 global $wp_locale, $post; … … 879 1151 } 880 1152 881 1153 /** 1154 * the_weekday_date() - {@internal Missing Short Description}} 1155 * 1156 * {@internal Missing Long Description}} 1157 * 1158 * @since 0.71 1159 * 1160 * @param unknown_type $before 1161 * @param unknown_type $after 1162 */ 882 1163 function the_weekday_date($before='',$after='') { 883 1164 global $wp_locale, $post, $day, $previousweekday; … … 893 1174 } 894 1175 1176 /** 1177 * wp_head() - {@internal Missing Short Description}} 1178 * 1179 * {@internal Missing Long Description}} 1180 * 1181 * @since 1.2.0 1182 * @uses do_action() 1183 */ 895 1184 function wp_head() { 896 1185 do_action('wp_head'); 897 1186 } 898 1187 1188 /** 1189 * wp_footer() - {@internal Missing Short Description}} 1190 * 1191 * {@internal Missing Long Description}} 1192 * 1193 * @since 1.5.1 1194 * @uses do_action() 1195 */ 899 1196 function wp_footer() { 900 1197 do_action('wp_footer'); 901 1198 } 902 1199 1200 /** 1201 * rsd_link() - {@internal Missing Short Description}} 1202 * 1203 * {@internal Missing Long Description}} 1204 * 1205 * @since 2.0.0 1206 * 1207 */ 903 1208 function rsd_link() { 904 1209 echo '<link rel="EditURI" type="application/rsd+xml" title="RSD" href="' . get_bloginfo('wpurl') . "/xmlrpc.php?rsd\" />\n"; 905 1210 } 906 1211 1212 /** 1213 * wlwmanifest_link() - {@internal Missing Short Description}} 1214 * 1215 * {@internal Missing Long Description}} 1216 * 1217 * @since 2.3.1 1218 * 1219 */ 907 1220 function wlwmanifest_link() { 908 1221 echo '<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="' … … 910 1223 } 911 1224 1225 /** 1226 * noindex() - {@internal Missing Short Description}} 1227 * 1228 * {@internal Missing Long Description}} 1229 * 1230 * @since 2.1.0 1231 */ 912 1232 function noindex() { 913 1233 // If the blog is not public, tell robots to go away. … … 916 1236 } 917 1237 1238 /** 1239 * rich_edit_exists() - {@internal Missing Short Description}} 1240 * 1241 * {@internal Missing Long Description}} 1242 * 1243 * @since 2.1.0 1244 * 1245 * @return unknown 1246 */ 918 1247 function rich_edit_exists() { 919 1248 global $wp_rich_edit_exists; … … 923 1252 } 924 1253 1254 /** 1255 * user_can_richedit() - {@internal Missing Short Description}} 1256 * 1257 * {@internal Missing Long Description}} 1258 * 1259 * @since 2.0.0 1260 * 1261 * @return unknown 1262 */ 925 1263 function user_can_richedit() { 926 1264 global $wp_rich_edit, $pagenow; … … 940 1278 } 941 1279 1280 /** 1281 * wp_default_editor() - {@internal Missing Short Description}} 1282 * 1283 * {@internal Missing Long Description}} 1284 * 1285 * @since 2.5.0 1286 * 1287 * @return string Either 'tinymce', or 'html', or 'test' 1288 */ 942 1289 function wp_default_editor() { 943 1290 $r = user_can_richedit() ? 'tinymce' : 'html'; // defaults … … 949 1296 } 950 1297 1298 /** 1299 * the_editor() - {@internal Missing Short Description}} 1300 * 1301 * {@internal Missing Long Description}} 1302 * 1303 * @since 2.1.0 1304 * 1305 * @param unknown_type $content 1306 * @param unknown_type $id 1307 * @param unknown_type $prev_id 1308 */ 951 1309 function the_editor($content, $id = 'content', $prev_id = 'title', $media_buttons = true, $tab_index = 2) { 952 1310 $rows = get_option('default_post_edit_rows'); … … 1015 1373 } 1016 1374 1375 /** 1376 * get_search_query() - {@internal Missing Short Description}} 1377 * 1378 * {@internal Missing Long Description}} 1379 * 1380 * @since 2.3.0 1381 * 1382 * @return unknown 1383 */ 1017 1384 function get_search_query() { 1018 1385 return apply_filters( 'get_search_query', stripslashes( get_query_var( 's' ) ) ); 1019 1386 } 1020 1387 1388 /** 1389 * the_search_query() - {@internal Missing Short Description}} 1390 * 1391 * {@internal Missing Long Description}} 1392 * 1393 * @since 2.1.0 1394 * 1395 */ 1021 1396 function the_search_query() { 1022 1397 echo attribute_escape( apply_filters( 'the_search_query', get_search_query() ) ); 1023 1398 } 1024 1399 1400 /** 1401 * language_attributes() - {@internal Missing Short Description}} 1402 * 1403 * {@internal Missing Long Description}} 1404 * 1405 * @since 2.1.0 1406 * 1407 * @param unknown_type $doctype 1408 */ 1025 1409 function language_attributes($doctype = 'html') { 1026 1410 $attributes = array(); … … 1043 1427 } 1044 1428 1429 /** 1430 * paginate_links() - {@internal Missing Short Description}} 1431 * 1432 * {@internal Missing Long Description}} 1433 * 1434 * @since 2.1.0 1435 * 1436 * @param unknown_type $args 1437 * @return unknown 1438 */ 1045 1439 function paginate_links( $args = '' ) { 1046 1440 $defaults = array( … … 1137 1531 * @see WP_Styles::_css_href and its style_loader_src filter. 1138 1532 * 1533 * @since 2.3.0 1534 * 1535 * 1139 1536 * @param string $file file relative to wp-admin/ without its ".css" extension. 1140 1537 */ … … 1194 1591 1195 1592 /** 1196 * Enqueues the default ThickBox js and css. 1593 * wp_generator() - Outputs the XHTML generator that is generated on the wp_head hook. 1594 * 1595 * {@internal Missing Long Description}} 1596 * 1597 * @since 2.5.0 1598 * @uses apply_filters() 1599 * Enqueues the default ThickBox js and css. 1197 1600 * If any of the settings need to be changed, this can be done with another js file 1198 1601 * similar to media-upload.js and theme-preview.js. That file should require array('thickbox') … … 1207 1610 * Outputs the XHTML generator that is generated on the wp_head hook. 1208 1611 */ 1209 function wp_generator() 1210 { 1612 function wp_generator() { 1211 1613 the_generator( apply_filters( 'wp_generator_type', 'xhtml' ) ); 1212 1614 } 1213 1615 1214 1616 /** 1215 * Outputs the generator XML or Comment for RSS, ATOM, etc. 1216 * @param {String} $type The type of generator to return. 1217 */ 1218 function the_generator ( $type ) { 1219 echo apply_filters('the_generator',get_the_generator($type),$type) . "\n"; 1220 } 1221 1222 /** 1223 * Creates the generator XML or Comment for RSS, ATOM, etc. 1224 * @param {String} $type The type of generator to return. 1225 */ 1226 function get_the_generator ( $type ) { 1617 * the_generator() - Outputs the generator XML or Comment for RSS, ATOM, etc. 1618 * 1619 * {@internal Missing Long Description}} 1620 * 1621 * @since 2.5 1622 * @uses apply_filters() 1623 * 1624 * @param string $type The type of generator to return. 1625 */ 1626 function the_generator( $type ) { 1627 echo apply_filters('the_generator', get_the_generator($type), $type) . "\n"; 1628 } 1629 1630 /** 1631 * get_the_generator() - Creates the generator XML or Comment for RSS, ATOM, etc. 1632 * 1633 * {@internal Missing Long Description}} 1634 * 1635 * @since 2.5 1636 * @uses apply_filters() 1637 * 1638 * @param string $type The type of generator to return. 1639 */ 1640 function get_the_generator( $type ) { 1227 1641 switch ($type) { 1228 1642 case 'html': … … 1250 1664 return apply_filters( "get_the_generator_{$type}", $gen, $type ); 1251 1665 } 1666 1252 1667 ?>
Note: See TracChangeset
for help on using the changeset viewer.