Make WordPress Core


Ignore:
Timestamp:
10/02/2008 01:03:26 AM (16 years ago)
Author:
ryan
Message:

phpdoc for wp-admin/includes from jacobsantos. see #7527

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/template.php

    r9046 r9053  
    11<?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 */
    610
    711// 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 */
    823function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_page = 20 ) {
    924    $count = 0;
     
    1126}
    1227
     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 */
    1341function _cat_rows( $categories, &$count, $parent = 0, $level = 0, $page = 1, $per_page = 20 ) {
    1442    if ( empty($categories) ) {
     
    73101}
    74102
     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 */
    75113function _cat_row( $category, $level, $name_override = false ) {
    76114    global $class;
     
    145183}
    146184
     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 */
    147194function link_cat_row( $category, $name_override = false ) {
    148195    global $class;
     
    215262}
    216263
     264/**
     265 * {@internal Missing Short Description}}
     266 *
     267 * @since unknown
     268 *
     269 * @param unknown_type $checked
     270 * @param unknown_type $current
     271 */
    217272function checked( $checked, $current) {
    218273    if ( $checked == $current)
     
    220275}
    221276
     277/**
     278 * {@internal Missing Short Description}}
     279 *
     280 * @since unknown
     281 *
     282 * @param unknown_type $selected
     283 * @param unknown_type $current
     284 */
    222285function selected( $selected, $current) {
    223286    if ( $selected == $current)
     
    229292//
    230293
    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 */
    232305function dropdown_categories( $default = 0, $parent = 0, $popular_ids = array() ) {
    233306    global $post_ID;
     
    235308}
    236309
     310/**
     311 * {@internal Missing Short Description}}
     312 *
     313 * @since unknown
     314 */
    237315class Walker_Category_Checklist extends Walker {
    238316    var $tree_type = 'category';
     
    261339}
    262340
     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 */
    263351function wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false ) {
    264352    $walker = new Walker_Category_Checklist;
     
    302390}
    303391
     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 */
    304403function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) {
    305404    global $post_ID;
     
    330429}
    331430
    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 */
    333440function dropdown_link_categories( $default = 0 ) {
    334441    global $link_id;
     
    337444}
    338445
     446/**
     447 * {@internal Missing Short Description}}
     448 *
     449 * @since unknown
     450 *
     451 * @param unknown_type $link_id
     452 */
    339453function wp_link_category_checklist( $link_id = 0 ) {
    340454    $default = 1;
     
    368482// Returns a single tag row (see tag_rows below)
    369483// 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 */
    370493function _tag_row( $tag, $class = '' ) {
    371494        $count = number_format_i18n( $tag->count );
     
    423546// assuming M tags displayed at a time on the page
    424547// 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 */
    425558function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) {
    426559
     
    450583
    451584// 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 */
    452592function wp_manage_posts_columns() {
    453593    $posts_columns = array();
     
    472612
    473613// 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 */
    474621function wp_manage_media_columns() {
    475622    $posts_columns = array();
     
    489636}
    490637
     638/**
     639 * {@internal Missing Short Description}}
     640 *
     641 * @since unknown
     642 *
     643 * @return unknown
     644 */
    491645function wp_manage_pages_columns() {
    492646    $posts_columns = array();
     
    517671}
    518672
     673/**
     674 * {@internal Missing Short Description}}
     675 *
     676 * @since unknown
     677 *
     678 * @param unknown_type $page
     679 * @return unknown
     680 */
    519681function get_column_headers($page) {
    520682    switch ($page) {
     
    591753}
    592754
     755/**
     756 * {@internal Missing Short Description}}
     757 *
     758 * @since unknown
     759 *
     760 * @param unknown_type $type
     761 * @param unknown_type $id
     762 */
    593763function print_column_headers( $type, $id = true ) {
    594764    $columns = get_column_headers( $type );
     
    627797}
    628798
     799/**
     800 * {@internal Missing Short Description}}
     801 *
     802 * @since unknown
     803 *
     804 * @param unknown_type $type
     805 */
    629806function inline_edit_row( $type ) {
    630807    global $current_user, $mode;
     
    8691046}
    8701047
     1048/**
     1049 * {@internal Missing Short Description}}
     1050 *
     1051 * @since unknown
     1052 *
     1053 * @param unknown_type $data
     1054 */
    8711055function inline_save_row( $data ) {
    8721056    // get the original post content
     
    8971081
    8981082// 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 */
    8991090function get_inline_data($post) {
    9001091
     
    9341125}
    9351126
     1127/**
     1128 * {@internal Missing Short Description}}
     1129 *
     1130 * @since unknown
     1131 *
     1132 * @param unknown_type $posts
     1133 */
    9361134function post_rows( $posts = array() ) {
    9371135    global $wp_query, $post, $mode;
     
    9601158}
    9611159
     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 */
    9621169function _post_row($a_post, $pending_comments, $mode) {
    9631170    global $post;
     
    11741381 * display one row if the page doesn't have any children
    11751382 * 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
    11761391 */
    11771392function display_page_row( $page, $level = 0 ) {
     
    13301545 * displays pages in hierarchical order with paging support
    13311546 */
     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 */
    13321557function page_rows($pages, $pagenum = 1, $per_page = 20) {
    13331558    global $wpdb;
     
    14061631 * Given a top level page ID, display the nested hierarchy of sub-pages
    14071632 * 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
    14081645 */
    14091646function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {
     
    14491686}
    14501687
     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 */
    14511698function user_row( $user_object, $style = '', $role = '' ) {
    14521699    global $wp_roles;
     
    15321779}
    15331780
     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 */
    15341794function _wp_get_comment_list( $status = '', $s = false, $start, $num, $post = 0, $type = '' ) {
    15351795    global $wpdb;
     
    15841844}
    15851845
     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 */
    15861856function _wp_comment_row( $comment_id, $mode, $comment_status, $checkbox = true ) {
    15871857    global $comment, $post;
     
    17081978}
    17091979
     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 */
    17101989function wp_comment_reply($position = '1', $checkbox = false, $mode = 'single') {
    17111990    global $current_user;
     
    17512030}
    17522031
     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 */
    17532044function wp_dropdown_cats( $currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0 ) {
    17542045    if (!$categories )
     
    17722063}
    17732064
     2065/**
     2066 * {@internal Missing Short Description}}
     2067 *
     2068 * @since unknown
     2069 *
     2070 * @param unknown_type $meta
     2071 */
    17742072function list_meta( $meta ) {
    17752073    // Exit if no meta
     
    17942092}
    17952093
     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 */
    17962103function _list_meta_row( $entry, &$count ) {
    17972104    static $update_nonce = false;
     
    18362143}
    18372144
     2145/**
     2146 * {@internal Missing Short Description}}
     2147 *
     2148 * @since unknown
     2149 */
    18382150function meta_form() {
    18392151    global $wpdb;
     
    18822194}
    18832195
     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 */
    18842206function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) {
    18852207    global $wp_locale, $post, $comment;
     
    19322254}
    19332255
     2256/**
     2257 * {@internal Missing Short Description}}
     2258 *
     2259 * @since unknown
     2260 *
     2261 * @param unknown_type $default
     2262 */
    19342263function page_template_dropdown( $default = '' ) {
    19352264    $templates = get_page_templates();
     
    19442273}
    19452274
     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 */
    19462285function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) {
    19472286    global $wpdb, $post_ID;
     
    19702309}
    19712310
     2311/**
     2312 * {@internal Missing Short Description}}
     2313 *
     2314 * @since unknown
     2315 */
    19722316function browse_happy() {
    19732317    $getit = __( 'WordPress recommends a better browser' );
     
    19802324    add_action( 'in_admin_footer', 'browse_happy' );
    19812325
     2326/**
     2327 * {@internal Missing Short Description}}
     2328 *
     2329 * @since unknown
     2330 *
     2331 * @param unknown_type $id
     2332 * @return unknown
     2333 */
    19822334function the_attachment_links( $id = false ) {
    19832335    $id = (int) $id;
     
    20232375}
    20242376
     2377/**
     2378 * {@internal Missing Short Description}}
     2379 *
     2380 * @since unknown
     2381 *
     2382 * @param unknown_type $default
     2383 */
    20252384function wp_dropdown_roles( $default = false ) {
    20262385    global $wp_roles;
     
    20372396}
    20382397
     2398/**
     2399 * {@internal Missing Short Description}}
     2400 *
     2401 * @since unknown
     2402 *
     2403 * @param unknown_type $size
     2404 * @return unknown
     2405 */
    20392406function wp_convert_hr_to_bytes( $size ) {
    20402407    $size = strtolower($size);
     
    20492416}
    20502417
     2418/**
     2419 * {@internal Missing Short Description}}
     2420 *
     2421 * @since unknown
     2422 *
     2423 * @param unknown_type $bytes
     2424 * @return unknown
     2425 */
    20512426function wp_convert_bytes_to_hr( $bytes ) {
    20522427    $units = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' );
     
    20572432}
    20582433
     2434/**
     2435 * {@internal Missing Short Description}}
     2436 *
     2437 * @since unknown
     2438 *
     2439 * @return unknown
     2440 */
    20592441function wp_max_upload_size() {
    20602442    $u_bytes = wp_convert_hr_to_bytes( ini_get( 'upload_max_filesize' ) );
     
    20642446}
    20652447
     2448/**
     2449 * {@internal Missing Short Description}}
     2450 *
     2451 * @since unknown
     2452 *
     2453 * @param unknown_type $action
     2454 */
    20662455function wp_import_upload_form( $action ) {
    20672456    $bytes = apply_filters( 'import_upload_size_limit', wp_max_upload_size() );
     
    20832472}
    20842473
     2474/**
     2475 * {@internal Missing Short Description}}
     2476 *
     2477 * @since unknown
     2478 */
    20852479function wp_remember_old_slug() {
    20862480    global $post;
     
    20912485
    20922486/**
    2093  * add_meta_box() - Add a meta box to an edit form
    2094  *
    2095  * @since 2.5
     2487 * Add a meta box to an edit form.
     2488 *
     2489 * @since 2.5.0
    20962490 *
    20972491 * @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.
    20992493 * @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').
    21032497 */
    21042498function add_meta_box($id, $title, $callback, $page, $context = 'advanced', $priority = 'default') {
     
    21522546}
    21532547
     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 */
    21542558function do_meta_boxes($page, $context, $object) {
    21552559    global $wp_meta_boxes;
     
    22032607
    22042608/**
    2205  * remove_meta_box() - Remove a meta box from an edit form
    2206  *
    2207  * @since 2.6
     2609 * Remove a meta box from an edit form.
     2610 *
     2611 * @since 2.6.0
    22082612 *
    22092613 * @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').
    22122616 */
    22132617function remove_meta_box($id, $page, $context) {
     
    22252629}
    22262630
     2631/**
     2632 * {@internal Missing Short Description}}
     2633 *
     2634 * @since unknown
     2635 *
     2636 * @param unknown_type $page
     2637 */
    22272638function meta_box_prefs($page) {
    22282639    global $wp_meta_boxes;
     
    22512662
    22522663/**
    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
    22562667 *
    22572668 * @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.
    22592670 * @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, ...).
    22612672 */
    22622673function add_settings_section($id, $title, $callback, $page) {
     
    22742685
    22752686/**
    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
    22792690 *
    22802691 * @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.
    22822693 * @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, ...).
    22852696 * @param array $args Additional arguments
    22862697 */
     
    22982709}
    22992710
     2711/**
     2712 * {@internal Missing Short Description}}
     2713 *
     2714 * @since unknown
     2715 *
     2716 * @param unknown_type $page
     2717 */
    23002718function do_settings_sections($page) {
    23012719    global $wp_settings_sections, $wp_settings_fields;
     
    23152733}
    23162734
     2735/**
     2736 * {@internal Missing Short Description}}
     2737 *
     2738 * @since unknown
     2739 *
     2740 * @param unknown_type $page
     2741 * @param unknown_type $section
     2742 */
    23172743function do_settings_fields($page, $section) {
    23182744    global $wp_settings_fields;
     
    23342760}
    23352761
     2762/**
     2763 * {@internal Missing Short Description}}
     2764 *
     2765 * @since unknown
     2766 *
     2767 * @param unknown_type $page
     2768 */
    23362769function manage_columns_prefs($page) {
    23372770    $columns = get_column_headers($page);
     
    23552788}
    23562789
     2790/**
     2791 * {@internal Missing Short Description}}
     2792 *
     2793 * @since unknown
     2794 *
     2795 * @param unknown_type $found_action
     2796 */
    23572797function find_posts_div($found_action = '') {
    23582798?>
     
    24852925 * Display the post password.
    24862926 *
    2487  * The password is passed through {@link attribute_escape()}
    2488  * to ensure that it is 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.
    24892929 *
    24902930 * @uses attribute_escape
     
    24962936}
    24972937
     2938/**
     2939 * {@internal Missing Short Description}}
     2940 *
     2941 * @since unknown
     2942 */
    24982943function favorite_actions() {
    24992944    $actions = array(
     
    25132958    echo "</div></div>\n";
    25142959}
     2960
    25152961/**
    25162962 * Get the post title.
    25172963 *
    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.
    25192966 *
    25202967 * @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.
    25222969 *
    25232970 */
     
    25292976    return $title;
    25302977}
     2978
    25312979?>
Note: See TracChangeset for help on using the changeset viewer.