WordPress.org

Make WordPress Core

Changeset 15564


Ignore:
Timestamp:
09/05/10 02:45:39 (4 years ago)
Author:
nacin
Message:

phpdoc, @since, whitespace. Also require an argument in wp_insert_post(). props duck_, see #14783.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r15528 r15564  
    1010 * Executing AJAX process. 
    1111 * 
    12  * @since unknown 
     12 * @since 2.1.0 
    1313 */ 
    1414define('DOING_AJAX', true); 
  • trunk/wp-admin/custom-background.php

    r15231 r15564  
    312312 
    313313    /** 
    314      * Handle a Image upload for the background image. 
     314     * Handle an Image upload for the background image. 
    315315     * 
    316316     * @since 3.0.0 
  • trunk/wp-admin/includes/bookmark.php

    r15315 r15564  
    88 
    99/** 
    10  * {@internal Missing Short Description}} 
    11  * 
    12  * @since unknown 
    13  * 
    14  * @return unknown 
     10 * Add a link to using values provided in $_POST. 
     11 * 
     12 * @since 2.0.0 
     13 * 
     14 * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success. 
    1515 */ 
    1616function add_link() { 
     
    1919 
    2020/** 
    21  * {@internal Missing Short Description}} 
    22  * 
    23  * @since unknown 
    24  * 
    25  * @param unknown_type $link_id 
    26  * @return unknown 
    27  */ 
    28 function edit_link( $link_id = '' ) { 
    29     if (!current_user_can( 'manage_links' )) 
    30         wp_die( __( 'Cheatin’ uh?' )); 
     21 * Update or insert a link using values provided in $_POST. 
     22 * 
     23 * @since 2.0.0 
     24 * 
     25 * @param int $link_id Optional. ID of the link to edit. 
     26 * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success. 
     27 */ 
     28function edit_link( $link_id = 0 ) { 
     29    if ( !current_user_can( 'manage_links' ) ) 
     30        wp_die( __( 'Cheatin’ uh?' ) ); 
    3131 
    3232    $_POST['link_url'] = esc_html( $_POST['link_url'] ); 
     
    4040    if ( !empty( $link_id ) ) { 
    4141        $_POST['link_id'] = $link_id; 
    42         return wp_update_link( $_POST); 
     42        return wp_update_link( $_POST ); 
    4343    } else { 
    44         return wp_insert_link( $_POST); 
    45     } 
    46 } 
    47  
    48 /** 
    49  * {@internal Missing Short Description}} 
    50  * 
    51  * @since unknown 
    52  * 
    53  * @return unknown 
     44        return wp_insert_link( $_POST ); 
     45    } 
     46} 
     47 
     48/** 
     49 * Retrieve the default link for editing. 
     50 * 
     51 * @since 2.0.0 
     52 * 
     53 * @return object Default link 
    5454 */ 
    5555function get_default_link_to_edit() { 
    5656    if ( isset( $_GET['linkurl'] ) ) 
    57         $link->link_url = esc_url( $_GET['linkurl']); 
     57        $link->link_url = esc_url( $_GET['linkurl'] ); 
    5858    else 
    5959        $link->link_url = ''; 
    6060 
    6161    if ( isset( $_GET['name'] ) ) 
    62         $link->link_name = esc_attr( $_GET['name']); 
     62        $link->link_name = esc_attr( $_GET['name'] ); 
    6363    else 
    6464        $link->link_name = ''; 
     
    7070 
    7171/** 
    72  * {@internal Missing Short Description}} 
    73  * 
    74  * @since unknown 
    75  * 
    76  * @param unknown_type $link_id 
    77  * @return unknown 
     72 * Delete link specified from database 
     73 * 
     74 * @since 2.0.0 
     75 * 
     76 * @param int $link_id ID of the link to delete 
     77 * @return bool True 
    7878 */ 
    7979function wp_delete_link( $link_id ) { 
     
    9494 
    9595/** 
    96  * {@internal Missing Short Description}} 
    97  * 
    98  * @since unknown 
    99  * 
    100  * @param unknown_type $link_id 
    101  * @return unknown 
     96 * Retrieves the link categories associated with the link specified. 
     97 * 
     98 * @since 2.1.0 
     99 * 
     100 * @param int $link_id Link ID to look up 
     101 * @return array The requested link's categories 
    102102 */ 
    103103function wp_get_link_cats( $link_id = 0 ) { 
     
    109109 
    110110/** 
    111  * {@internal Missing Short Description}} 
    112  * 
    113  * @since unknown 
    114  * 
    115  * @param unknown_type $link_id 
    116  * @return unknown 
     111 * Retrieve link data based on ID. 
     112 * 
     113 * @since 2.0.0 
     114 * 
     115 * @param int $link_id ID of link to retrieve 
     116 * @return object Link for editing 
    117117 */ 
    118118function get_link_to_edit( $link_id ) { 
     
    121121 
    122122/** 
    123  * {@internal Missing Short Description}} 
    124  * 
    125  * @since unknown 
    126  * 
    127  * @param unknown_type $linkdata 
    128  * @return unknown 
     123 * This function inserts/updates links into/in the database.  
     124 * 
     125 * @since 2.0.0 
     126 * 
     127 * @param array $linkdata Elements that make up the link to insert. 
     128 * @param bool $wp_error Optional. If true return WP_Error object on failure. 
     129 * @return int|WP_Error Value 0 or WP_Error on failure. The link ID on success. 
    129130 */ 
    130131function wp_insert_link( $linkdata, $wp_error = false ) { 
     
    182183 
    183184    // Make sure we set a valid category 
    184     if ( ! isset( $link_category ) ||0 == count( $link_category ) || !is_array( $link_category ) ) { 
     185    if ( ! isset( $link_category ) || 0 == count( $link_category ) || !is_array( $link_category ) ) { 
    185186        $link_category = array( get_option( 'default_link_category' ) ); 
    186187    } 
     
    216217 
    217218/** 
    218  * {@internal Missing Short Description}} 
    219  * 
    220  * @since unknown 
    221  * 
    222  * @param unknown_type $link_id 
    223  * @param unknown_type $link_categories 
     219 * Update link with the specified link categories. 
     220 * 
     221 * @since 2.1.0 
     222 * 
     223 * @param int $link_id ID of link to update 
     224 * @param array $link_categories Array of categories to  
    224225 */ 
    225226function wp_set_link_cats( $link_id = 0, $link_categories = array() ) { 
     
    234235 
    235236    clean_bookmark_cache( $link_id ); 
    236 }   // wp_set_link_cats() 
    237  
    238 /** 
    239  * {@internal Missing Short Description}} 
    240  * 
    241  * @since unknown 
    242  * 
    243  * @param unknown_type $linkdata 
    244  * @return unknown 
     237} 
     238 
     239/** 
     240 * Update a link in the database. 
     241 * 
     242 * @since 2.0.0 
     243 * 
     244 * @param array $linkdata Link data to update. 
     245 * @return int|WP_Error Value 0 or WP_Error on failure. The updated link ID on success. 
    245246 */ 
    246247function wp_update_link( $linkdata ) { 
  • trunk/wp-admin/includes/comment.php

    r15512 r15564  
    1010 * {@internal Missing Short Description}} 
    1111 * 
    12  * @since unknown 
     12 * @since 2.0.0 
    1313 * @uses $wpdb 
    1414 * 
    15  * @param string $comment_author 
    16  * @param string $comment_date 
     15 * @param string $comment_author Author of the comment 
     16 * @param string $comment_date Date of the comment 
    1717 * @return mixed Comment ID on success. 
    1818 */ 
     
    2828 
    2929/** 
    30  * {@internal Missing Short Description}} 
     30 * Update a comment with values provided in $_POST. 
    3131 * 
    32  * @since unknown 
     32 * @since 2.0.0 
    3333 */ 
    3434function edit_comment() { 
    35  
    3635    $comment_post_ID = (int) $_POST['comment_post_ID']; 
    3736 
    3837    if (!current_user_can( 'edit_post', $comment_post_ID )) 
    39         wp_die( __('You are not allowed to edit comments on this post, so you cannot edit this comment.' )); 
     38        wp_die( __('You are not allowed to edit comments on this post, so you cannot edit this comment.' ) ); 
    4039 
    4140    $_POST['comment_author'] = $_POST['newcomment_author']; 
     
    5352    } 
    5453 
    55     if (!empty ( $_POST['edit_date'] ) ) { 
     54    if ( !empty ( $_POST['edit_date'] ) ) { 
    5655        $aa = $_POST['aa']; 
    5756        $mm = $_POST['mm']; 
     
    6766    } 
    6867 
    69     wp_update_comment( $_POST); 
     68    wp_update_comment( $_POST ); 
    7069} 
    7170 
     
    7372 * {@internal Missing Short Description}} 
    7473 * 
    75  * @since unknown 
     74 * @since 2.0.0 
    7675 * 
    77  * @param unknown_type $id 
    78  * @return unknown 
     76 * @param int $id ID of comment to retrieve 
     77 * @return bool|object Comment if found. False on failure. 
    7978 */ 
    8079function get_comment_to_edit( $id ) { 
     
    9998 * Get the number of pending comments on a post or posts 
    10099 * 
    101  * @since unknown 
     100 * @since 2.3.0 
    102101 * @uses $wpdb 
    103102 * 
  • trunk/wp-admin/includes/dashboard.php

    r15487 r15564  
    1010 * Registers dashboard widgets. 
    1111 * 
    12  * handles POST data, sets up filters. 
    13  * 
    14  * @since unknown 
     12 * Handles POST data, sets up filters. 
     13 * 
     14 * @since 2.5.0 
    1515 */ 
    1616function wp_dashboard_setup() { 
     
    151151 * Displays the dashboard. 
    152152 * 
    153  * @since unknown 
     153 * @since 2.5.0 
    154154 */ 
    155155function wp_dashboard() { 
     
    518518 * Display recent comments dashboard widget content. 
    519519 * 
    520  * @since unknown 
     520 * @since 2.5.0 
    521521 */ 
    522522function wp_dashboard_recent_comments() { 
     
    704704 * Display incoming links dashboard widget content. 
    705705 * 
    706  * @since unknown 
     706 * @since 2.5.0 
    707707 */ 
    708708function wp_dashboard_incoming_links_output() { 
     
    796796 * {@internal Missing Short Description}} 
    797797 * 
    798  * @since unknown 
    799  * 
    800  * @param int $widget_id 
     798 * @since 2.5.0 
     799 * 
     800 * @param string $widget_id 
    801801 */ 
    802802function wp_dashboard_rss_output( $widget_id ) { 
     
    818818 * Display secondary dashboard RSS widget feed. 
    819819 * 
    820  * @since unknown 
     820 * @since 2.5.0 
    821821 * 
    822822 * @return unknown 
     
    853853 * Display plugins most popular, newest plugins, and recently updated widget text. 
    854854 * 
    855  * @since unknown 
     855 * @since 2.5.0 
    856856 */ 
    857857function wp_dashboard_plugins_output() { 
     
    939939 * which is later replaced by AJAX call (see top of /wp-admin/index.php) 
    940940 * 
    941  * @since unknown 
    942  * 
    943  * @param int $widget_id 
     941 * @since 2.5.0 
     942 * 
     943 * @param string $widget_id 
    944944 * @param callback $callback 
    945945 * @param array $check_urls RSS feeds 
     
    982982 * Calls widget control callback. 
    983983 * 
    984  * @since unknown 
     984 * @since 2.5.0 
    985985 * 
    986986 * @param int $widget_control_id Registered Widget ID. 
     
    10001000 * from RSS-type widgets. 
    10011001 * 
    1002  * @since unknown 
    1003  * 
    1004  * @param string widget_id 
    1005  * @param array form_inputs 
     1002 * @since 2.5.0 
     1003 * 
     1004 * @param string $widget_id 
     1005 * @param array $form_inputs 
    10061006 */ 
    10071007function wp_dashboard_rss_control( $widget_id, $form_inputs = array() ) { 
  • trunk/wp-includes/general-template.php

    r15460 r15564  
    382382 * The possible values for the 'show' parameter are listed below. 
    383383 * <ol> 
    384  * <li><strong>url<strong> - Blog URI to homepage.</li> 
     384 * <li><strong>url</strong> - Blog URI to homepage.</li> 
    385385 * <li><strong>wpurl</strong> - Blog URI path to WordPress.</li> 
    386386 * <li><strong>description</strong> - Secondary title</li> 
     
    13191319 * Will only output the date if the current post's date is different from the 
    13201320 * previous one output. 
    1321  
     1321 * 
    13221322 * i.e. Only one date listing will show per day worth of posts shown in the loop, even if the 
    13231323 * function is called several times for each post. 
  • trunk/wp-includes/post.php

    r15563 r15564  
    21262126 * 
    21272127 * @since 1.0.0 
    2128  * @link http://core.trac.wordpress.org/ticket/9084 Bug report on 'wp_insert_post_data' filter. 
    21292128 * @uses $wpdb 
    21302129 * @uses $wp_rewrite 
    21312130 * @uses $user_ID 
    2132  * 
    21332131 * @uses do_action() Calls 'pre_post_update' on post ID if this is an update. 
    21342132 * @uses do_action() Calls 'edit_post' action on post ID and post data if this is an update. 
    2135  * @uses do_action() Calls 'save_post' and 'wp_insert_post' on post id and post data just before 
    2136  *                   returning. 
    2137  * 
    2138  * @uses apply_filters() Calls 'wp_insert_post_data' passing $data, $postarr prior to database 
    2139  *                       update or insert. 
     2133 * @uses do_action() Calls 'save_post' and 'wp_insert_post' on post id and post data just before returning. 
     2134 * @uses apply_filters() Calls 'wp_insert_post_data' passing $data, $postarr prior to database update or insert. 
    21402135 * @uses wp_transition_post_status() 
    21412136 * 
    2142  * @param array $postarr Optional. Overrides defaults. 
     2137 * @param array $postarr Elements that make up post to insert. 
    21432138 * @param bool $wp_error Optional. Allow return of WP_Error on failure. 
    21442139 * @return int|WP_Error The value 0 or WP_Error on failure. The post ID on success. 
    21452140 */ 
    2146 function wp_insert_post($postarr = array(), $wp_error = false) { 
     2141function wp_insert_post($postarr, $wp_error = false) { 
    21472142    global $wpdb, $wp_rewrite, $user_ID; 
    21482143 
  • trunk/wp-includes/wp-db.php

    r15537 r15564  
    4949 * @subpackage Database 
    5050 * @since 0.71 
    51  * @final 
    5251 */ 
    5352class wpdb { 
Note: See TracChangeset for help on using the changeset viewer.