Changeset 9053 for trunk/wp-admin/includes/template.php
- Timestamp:
- 10/02/2008 01:03:26 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r9046 r9053 1 1 <?php 2 3 // 4 // Big Mess 5 // 2 /** 3 * Template WordPress Administration API. 4 * 5 * A Big Mess. Also some neat functions that are nicely written. 6 * 7 * @package WordPress 8 * @subpackage Administration 9 */ 6 10 7 11 // Ugly recursive category stuff. 12 /** 13 * {@internal Missing Short Description}} 14 * 15 * @since unknown 16 * 17 * @param unknown_type $parent 18 * @param unknown_type $level 19 * @param unknown_type $categories 20 * @param unknown_type $page 21 * @param unknown_type $per_page 22 */ 8 23 function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_page = 20 ) { 9 24 $count = 0; … … 11 26 } 12 27 28 /** 29 * {@internal Missing Short Description}} 30 * 31 * @since unknown 32 * 33 * @param unknown_type $categories 34 * @param unknown_type $count 35 * @param unknown_type $parent 36 * @param unknown_type $level 37 * @param unknown_type $page 38 * @param unknown_type $per_page 39 * @return unknown 40 */ 13 41 function _cat_rows( $categories, &$count, $parent = 0, $level = 0, $page = 1, $per_page = 20 ) { 14 42 if ( empty($categories) ) { … … 73 101 } 74 102 103 /** 104 * {@internal Missing Short Description}} 105 * 106 * @since unknown 107 * 108 * @param unknown_type $category 109 * @param unknown_type $level 110 * @param unknown_type $name_override 111 * @return unknown 112 */ 75 113 function _cat_row( $category, $level, $name_override = false ) { 76 114 global $class; … … 145 183 } 146 184 185 /** 186 * {@internal Missing Short Description}} 187 * 188 * @since unknown 189 * 190 * @param unknown_type $category 191 * @param unknown_type $name_override 192 * @return unknown 193 */ 147 194 function link_cat_row( $category, $name_override = false ) { 148 195 global $class; … … 215 262 } 216 263 264 /** 265 * {@internal Missing Short Description}} 266 * 267 * @since unknown 268 * 269 * @param unknown_type $checked 270 * @param unknown_type $current 271 */ 217 272 function checked( $checked, $current) { 218 273 if ( $checked == $current) … … 220 275 } 221 276 277 /** 278 * {@internal Missing Short Description}} 279 * 280 * @since unknown 281 * 282 * @param unknown_type $selected 283 * @param unknown_type $current 284 */ 222 285 function selected( $selected, $current) { 223 286 if ( $selected == $current) … … 229 292 // 230 293 231 // Deprecated. Use wp_link_category_checklist 294 /** 295 * {@internal Missing Short Description}} 296 * 297 * @since unknown 298 * @deprecated Use {@link wp_link_category_checklist()} 299 * @see wp_link_category_checklist() 300 * 301 * @param unknown_type $default 302 * @param unknown_type $parent 303 * @param unknown_type $popular_ids 304 */ 232 305 function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) { 233 306 global $post_ID; … … 235 308 } 236 309 310 /** 311 * {@internal Missing Short Description}} 312 * 313 * @since unknown 314 */ 237 315 class Walker_Category_Checklist extends Walker { 238 316 var $tree_type = 'category'; … … 261 339 } 262 340 341 /** 342 * {@internal Missing Short Description}} 343 * 344 * @since unknown 345 * 346 * @param unknown_type $post_id 347 * @param unknown_type $descendants_and_self 348 * @param unknown_type $selected_cats 349 * @param unknown_type $popular_cats 350 */ 263 351 function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false ) { 264 352 $walker = new Walker_Category_Checklist; … … 302 390 } 303 391 392 /** 393 * {@internal Missing Short Description}} 394 * 395 * @since unknown 396 * 397 * @param unknown_type $taxonomy 398 * @param unknown_type $default 399 * @param unknown_type $number 400 * @param unknown_type $echo 401 * @return unknown 402 */ 304 403 function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) { 305 404 global $post_ID; … … 330 429 } 331 430 332 // Deprecated. Use wp_link_category_checklist 431 /** 432 * {@internal Missing Short Description}} 433 * 434 * @since unknown 435 * @deprecated Use {@link wp_link_category_checklist()} 436 * @see wp_link_category_checklist() 437 * 438 * @param unknown_type $default 439 */ 333 440 function dropdown_link_categories( $default = 0 ) { 334 441 global $link_id; … … 337 444 } 338 445 446 /** 447 * {@internal Missing Short Description}} 448 * 449 * @since unknown 450 * 451 * @param unknown_type $link_id 452 */ 339 453 function wp_link_category_checklist( $link_id = 0 ) { 340 454 $default = 1; … … 368 482 // Returns a single tag row (see tag_rows below) 369 483 // Note: this is also used in admin-ajax.php! 484 /** 485 * {@internal Missing Short Description}} 486 * 487 * @since unknown 488 * 489 * @param unknown_type $tag 490 * @param unknown_type $class 491 * @return unknown 492 */ 370 493 function _tag_row( $tag, $class = '' ) { 371 494 $count = number_format_i18n( $tag->count ); … … 423 546 // assuming M tags displayed at a time on the page 424 547 // Returns the number of tags displayed 548 /** 549 * {@internal Missing Short Description}} 550 * 551 * @since unknown 552 * 553 * @param unknown_type $page 554 * @param unknown_type $pagesize 555 * @param unknown_type $searchterms 556 * @return unknown 557 */ 425 558 function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) { 426 559 … … 450 583 451 584 // define the columns to display, the syntax is 'internal name' => 'display name' 585 /** 586 * {@internal Missing Short Description}} 587 * 588 * @since unknown 589 * 590 * @return unknown 591 */ 452 592 function wp_manage_posts_columns() { 453 593 $posts_columns = array(); … … 472 612 473 613 // define the columns to display, the syntax is 'internal name' => 'display name' 614 /** 615 * {@internal Missing Short Description}} 616 * 617 * @since unknown 618 * 619 * @return unknown 620 */ 474 621 function wp_manage_media_columns() { 475 622 $posts_columns = array(); … … 489 636 } 490 637 638 /** 639 * {@internal Missing Short Description}} 640 * 641 * @since unknown 642 * 643 * @return unknown 644 */ 491 645 function wp_manage_pages_columns() { 492 646 $posts_columns = array(); … … 517 671 } 518 672 673 /** 674 * {@internal Missing Short Description}} 675 * 676 * @since unknown 677 * 678 * @param unknown_type $page 679 * @return unknown 680 */ 519 681 function get_column_headers($page) { 520 682 switch ($page) { … … 591 753 } 592 754 755 /** 756 * {@internal Missing Short Description}} 757 * 758 * @since unknown 759 * 760 * @param unknown_type $type 761 * @param unknown_type $id 762 */ 593 763 function print_column_headers( $type, $id = true ) { 594 764 $columns = get_column_headers( $type ); … … 627 797 } 628 798 799 /** 800 * {@internal Missing Short Description}} 801 * 802 * @since unknown 803 * 804 * @param unknown_type $type 805 */ 629 806 function inline_edit_row( $type ) { 630 807 global $current_user, $mode; … … 869 1046 } 870 1047 1048 /** 1049 * {@internal Missing Short Description}} 1050 * 1051 * @since unknown 1052 * 1053 * @param unknown_type $data 1054 */ 871 1055 function inline_save_row( $data ) { 872 1056 // get the original post content … … 897 1081 898 1082 // adds hidden fields with the data for use in the inline editor 1083 /** 1084 * {@internal Missing Short Description}} 1085 * 1086 * @since unknown 1087 * 1088 * @param unknown_type $post 1089 */ 899 1090 function get_inline_data($post) { 900 1091 … … 934 1125 } 935 1126 1127 /** 1128 * {@internal Missing Short Description}} 1129 * 1130 * @since unknown 1131 * 1132 * @param unknown_type $posts 1133 */ 936 1134 function post_rows( $posts = array() ) { 937 1135 global $wp_query, $post, $mode; … … 960 1158 } 961 1159 1160 /** 1161 * {@internal Missing Short Description}} 1162 * 1163 * @since unknown 1164 * 1165 * @param unknown_type $a_post 1166 * @param unknown_type $pending_comments 1167 * @param unknown_type $mode 1168 */ 962 1169 function _post_row($a_post, $pending_comments, $mode) { 963 1170 global $post; … … 1174 1381 * display one row if the page doesn't have any children 1175 1382 * otherwise, display the row and its children in subsequent rows 1383 */ 1384 /** 1385 * {@internal Missing Short Description}} 1386 * 1387 * @since unknown 1388 * 1389 * @param unknown_type $page 1390 * @param unknown_type $level 1176 1391 */ 1177 1392 function display_page_row( $page, $level = 0 ) { … … 1330 1545 * displays pages in hierarchical order with paging support 1331 1546 */ 1547 /** 1548 * {@internal Missing Short Description}} 1549 * 1550 * @since unknown 1551 * 1552 * @param unknown_type $pages 1553 * @param unknown_type $pagenum 1554 * @param unknown_type $per_page 1555 * @return unknown 1556 */ 1332 1557 function page_rows($pages, $pagenum = 1, $per_page = 20) { 1333 1558 global $wpdb; … … 1406 1631 * Given a top level page ID, display the nested hierarchy of sub-pages 1407 1632 * together with paging support 1633 */ 1634 /** 1635 * {@internal Missing Short Description}} 1636 * 1637 * @since unknown 1638 * 1639 * @param unknown_type $children_pages 1640 * @param unknown_type $count 1641 * @param unknown_type $parent 1642 * @param unknown_type $level 1643 * @param unknown_type $pagenum 1644 * @param unknown_type $per_page 1408 1645 */ 1409 1646 function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) { … … 1449 1686 } 1450 1687 1688 /** 1689 * {@internal Missing Short Description}} 1690 * 1691 * @since unknown 1692 * 1693 * @param unknown_type $user_object 1694 * @param unknown_type $style 1695 * @param unknown_type $role 1696 * @return unknown 1697 */ 1451 1698 function user_row( $user_object, $style = '', $role = '' ) { 1452 1699 global $wp_roles; … … 1532 1779 } 1533 1780 1781 /** 1782 * {@internal Missing Short Description}} 1783 * 1784 * @since unknown 1785 * 1786 * @param unknown_type $status 1787 * @param unknown_type $s 1788 * @param unknown_type $start 1789 * @param unknown_type $num 1790 * @param unknown_type $post 1791 * @param unknown_type $type 1792 * @return unknown 1793 */ 1534 1794 function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) { 1535 1795 global $wpdb; … … 1584 1844 } 1585 1845 1846 /** 1847 * {@internal Missing Short Description}} 1848 * 1849 * @since unknown 1850 * 1851 * @param unknown_type $comment_id 1852 * @param unknown_type $mode 1853 * @param unknown_type $comment_status 1854 * @param unknown_type $checkbox 1855 */ 1586 1856 function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true ) { 1587 1857 global $comment, $post; … … 1708 1978 } 1709 1979 1980 /** 1981 * {@internal Missing Short Description}} 1982 * 1983 * @since unknown 1984 * 1985 * @param unknown_type $position 1986 * @param unknown_type $checkbox 1987 * @param unknown_type $mode 1988 */ 1710 1989 function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single') { 1711 1990 global $current_user; … … 1751 2030 } 1752 2031 2032 /** 2033 * {@internal Missing Short Description}} 2034 * 2035 * @since unknown 2036 * 2037 * @param unknown_type $currentcat 2038 * @param unknown_type $currentparent 2039 * @param unknown_type $parent 2040 * @param unknown_type $level 2041 * @param unknown_type $categories 2042 * @return unknown 2043 */ 1753 2044 function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) { 1754 2045 if (!$categories ) … … 1772 2063 } 1773 2064 2065 /** 2066 * {@internal Missing Short Description}} 2067 * 2068 * @since unknown 2069 * 2070 * @param unknown_type $meta 2071 */ 1774 2072 function list_meta( $meta ) { 1775 2073 // Exit if no meta … … 1794 2092 } 1795 2093 2094 /** 2095 * {@internal Missing Short Description}} 2096 * 2097 * @since unknown 2098 * 2099 * @param unknown_type $entry 2100 * @param unknown_type $count 2101 * @return unknown 2102 */ 1796 2103 function _list_meta_row( $entry, &$count ) { 1797 2104 static $update_nonce = false; … … 1836 2143 } 1837 2144 2145 /** 2146 * {@internal Missing Short Description}} 2147 * 2148 * @since unknown 2149 */ 1838 2150 function meta_form() { 1839 2151 global $wpdb; … … 1882 2194 } 1883 2195 2196 /** 2197 * {@internal Missing Short Description}} 2198 * 2199 * @since unknown 2200 * 2201 * @param unknown_type $edit 2202 * @param unknown_type $for_post 2203 * @param unknown_type $tab_index 2204 * @param unknown_type $multi 2205 */ 1884 2206 function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { 1885 2207 global $wp_locale, $post, $comment; … … 1932 2254 } 1933 2255 2256 /** 2257 * {@internal Missing Short Description}} 2258 * 2259 * @since unknown 2260 * 2261 * @param unknown_type $default 2262 */ 1934 2263 function page_template_dropdown( $default = '' ) { 1935 2264 $templates = get_page_templates(); … … 1944 2273 } 1945 2274 2275 /** 2276 * {@internal Missing Short Description}} 2277 * 2278 * @since unknown 2279 * 2280 * @param unknown_type $default 2281 * @param unknown_type $parent 2282 * @param unknown_type $level 2283 * @return unknown 2284 */ 1946 2285 function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) { 1947 2286 global $wpdb, $post_ID; … … 1970 2309 } 1971 2310 2311 /** 2312 * {@internal Missing Short Description}} 2313 * 2314 * @since unknown 2315 */ 1972 2316 function browse_happy() { 1973 2317 $getit = __( 'WordPress recommends a better browser' ); … … 1980 2324 add_action( 'in_admin_footer', 'browse_happy' ); 1981 2325 2326 /** 2327 * {@internal Missing Short Description}} 2328 * 2329 * @since unknown 2330 * 2331 * @param unknown_type $id 2332 * @return unknown 2333 */ 1982 2334 function the_attachment_links( $id = false ) { 1983 2335 $id = (int) $id; … … 2023 2375 } 2024 2376 2377 /** 2378 * {@internal Missing Short Description}} 2379 * 2380 * @since unknown 2381 * 2382 * @param unknown_type $default 2383 */ 2025 2384 function wp_dropdown_roles( $default = false ) { 2026 2385 global $wp_roles; … … 2037 2396 } 2038 2397 2398 /** 2399 * {@internal Missing Short Description}} 2400 * 2401 * @since unknown 2402 * 2403 * @param unknown_type $size 2404 * @return unknown 2405 */ 2039 2406 function wp_convert_hr_to_bytes( $size ) { 2040 2407 $size = strtolower($size); … … 2049 2416 } 2050 2417 2418 /** 2419 * {@internal Missing Short Description}} 2420 * 2421 * @since unknown 2422 * 2423 * @param unknown_type $bytes 2424 * @return unknown 2425 */ 2051 2426 function wp_convert_bytes_to_hr( $bytes ) { 2052 2427 $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' ); … … 2057 2432 } 2058 2433 2434 /** 2435 * {@internal Missing Short Description}} 2436 * 2437 * @since unknown 2438 * 2439 * @return unknown 2440 */ 2059 2441 function wp_max_upload_size() { 2060 2442 $u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) ); … … 2064 2446 } 2065 2447 2448 /** 2449 * {@internal Missing Short Description}} 2450 * 2451 * @since unknown 2452 * 2453 * @param unknown_type $action 2454 */ 2066 2455 function wp_import_upload_form( $action ) { 2067 2456 $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() ); … … 2083 2472 } 2084 2473 2474 /** 2475 * {@internal Missing Short Description}} 2476 * 2477 * @since unknown 2478 */ 2085 2479 function wp_remember_old_slug() { 2086 2480 global $post; … … 2091 2485 2092 2486 /** 2093 * add_meta_box() - Add a meta box to an edit form2094 * 2095 * @since 2.5 2487 * Add a meta box to an edit form. 2488 * 2489 * @since 2.5.0 2096 2490 * 2097 2491 * @param string $id String for use in the 'id' attribute of tags. 2098 * @param string $title Title of the meta box 2492 * @param string $title Title of the meta box. 2099 2493 * @param string $callback Function that fills the box with the desired content. The function should echo its output. 2100 * @param string $page The type of edit page on which to show the box (post, page, link) 2101 * @param string $context The context within the page where the boxes should show ('normal', 'advanced') 2102 * @param string $priority The priority within the context where the boxes should show ('high', 'low') 2494 * @param string $page The type of edit page on which to show the box (post, page, link). 2495 * @param string $context The context within the page where the boxes should show ('normal', 'advanced'). 2496 * @param string $priority The priority within the context where the boxes should show ('high', 'low'). 2103 2497 */ 2104 2498 function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default') { … … 2152 2546 } 2153 2547 2548 /** 2549 * {@internal Missing Short Description}} 2550 * 2551 * @since unknown 2552 * 2553 * @param unknown_type $page 2554 * @param unknown_type $context 2555 * @param unknown_type $object 2556 * @return unknown 2557 */ 2154 2558 function do_meta_boxes($page, $context, $object) { 2155 2559 global $wp_meta_boxes; … … 2203 2607 2204 2608 /** 2205 * remove_meta_box() - Remove a meta box from an edit form2206 * 2207 * @since 2.6 2609 * Remove a meta box from an edit form. 2610 * 2611 * @since 2.6.0 2208 2612 * 2209 2613 * @param string $id String for use in the 'id' attribute of tags. 2210 * @param string $page The type of edit page on which to show the box (post, page, link) 2211 * @param string $context The context within the page where the boxes should show ('normal', 'advanced') 2614 * @param string $page The type of edit page on which to show the box (post, page, link). 2615 * @param string $context The context within the page where the boxes should show ('normal', 'advanced'). 2212 2616 */ 2213 2617 function remove_meta_box($id, $page, $context) { … … 2225 2629 } 2226 2630 2631 /** 2632 * {@internal Missing Short Description}} 2633 * 2634 * @since unknown 2635 * 2636 * @param unknown_type $page 2637 */ 2227 2638 function meta_box_prefs($page) { 2228 2639 global $wp_meta_boxes; … … 2251 2662 2252 2663 /** 2253 * Add a new section to a settings page 2254 * 2255 * @since 2.7 2664 * Add a new section to a settings page. 2665 * 2666 * @since 2.7.0 2256 2667 * 2257 2668 * @param string $id String for use in the 'id' attribute of tags. 2258 * @param string $title Title of the section 2669 * @param string $title Title of the section. 2259 2670 * @param string $callback Function that fills the section with the desired content. The function should echo its output. 2260 * @param string $page The type of settings page on which to show the section (general, reading, writing, ...) 2671 * @param string $page The type of settings page on which to show the section (general, reading, writing, ...). 2261 2672 */ 2262 2673 function add_settings_section($id, $title, $callback, $page) { … … 2274 2685 2275 2686 /** 2276 * Add a new field to a settings page 2277 * 2278 * @since 2.7 2687 * Add a new field to a settings page. 2688 * 2689 * @since 2.7.0 2279 2690 * 2280 2691 * @param string $id String for use in the 'id' attribute of tags. 2281 * @param string $title Title of the field 2692 * @param string $title Title of the field. 2282 2693 * @param string $callback Function that fills the field with the desired content. The function should echo its output. 2283 * @param string $page The type of settings page on which to show the field (general, reading, writing, ...) 2284 * @param string $section The section of the settingss page in which to show the box (default, ...) 2694 * @param string $page The type of settings page on which to show the field (general, reading, writing, ...). 2695 * @param string $section The section of the settingss page in which to show the box (default, ...). 2285 2696 * @param array $args Additional arguments 2286 2697 */ … … 2298 2709 } 2299 2710 2711 /** 2712 * {@internal Missing Short Description}} 2713 * 2714 * @since unknown 2715 * 2716 * @param unknown_type $page 2717 */ 2300 2718 function do_settings_sections($page) { 2301 2719 global $wp_settings_sections, $wp_settings_fields; … … 2315 2733 } 2316 2734 2735 /** 2736 * {@internal Missing Short Description}} 2737 * 2738 * @since unknown 2739 * 2740 * @param unknown_type $page 2741 * @param unknown_type $section 2742 */ 2317 2743 function do_settings_fields($page, $section) { 2318 2744 global $wp_settings_fields; … … 2334 2760 } 2335 2761 2762 /** 2763 * {@internal Missing Short Description}} 2764 * 2765 * @since unknown 2766 * 2767 * @param unknown_type $page 2768 */ 2336 2769 function manage_columns_prefs($page) { 2337 2770 $columns = get_column_headers($page); … … 2355 2788 } 2356 2789 2790 /** 2791 * {@internal Missing Short Description}} 2792 * 2793 * @since unknown 2794 * 2795 * @param unknown_type $found_action 2796 */ 2357 2797 function find_posts_div($found_action = '') { 2358 2798 ?> … … 2485 2925 * Display the post password. 2486 2926 * 2487 * The password is passed through {@link attribute_escape()} 2488 * to ensure that itis safe for placing in an html attribute.2927 * The password is passed through {@link attribute_escape()} to ensure that it 2928 * is safe for placing in an html attribute. 2489 2929 * 2490 2930 * @uses attribute_escape … … 2496 2936 } 2497 2937 2938 /** 2939 * {@internal Missing Short Description}} 2940 * 2941 * @since unknown 2942 */ 2498 2943 function favorite_actions() { 2499 2944 $actions = array( … … 2513 2958 echo "</div></div>\n"; 2514 2959 } 2960 2515 2961 /** 2516 2962 * Get the post title. 2517 2963 * 2518 * The post title is fetched and if it is blank then a default string is returned. 2964 * The post title is fetched and if it is blank then a default string is 2965 * returned. 2519 2966 * 2520 2967 * @since 2.7.0 2521 * @param int $id The post id. If not supplied the global $post is used. .2968 * @param int $id The post id. If not supplied the global $post is used. 2522 2969 * 2523 2970 */ … … 2529 2976 return $title; 2530 2977 } 2978 2531 2979 ?>
Note: See TracChangeset
for help on using the changeset viewer.