WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/05/2010 02:45:39 AM (9 years ago)
Author:
nacin
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 ) {
Note: See TracChangeset for help on using the changeset viewer.