Changeset 15564 for trunk/wp-admin/includes/bookmark.php
- Timestamp:
- 09/05/2010 02:45:39 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/bookmark.php
r15315 r15564 8 8 9 9 /** 10 * {@internal Missing Short Description}}11 * 12 * @since unknown13 * 14 * @return unknown10 * 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. 15 15 */ 16 16 function add_link() { … … 19 19 20 20 /** 21 * {@internal Missing Short Description}}22 * 23 * @since unknown24 * 25 * @param unknown_type $link_id26 * @return unknown27 */ 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 */ 28 function edit_link( $link_id = 0 ) { 29 if ( !current_user_can( 'manage_links' ) ) 30 wp_die( __( 'Cheatin’ uh?' ) ); 31 31 32 32 $_POST['link_url'] = esc_html( $_POST['link_url'] ); … … 40 40 if ( !empty( $link_id ) ) { 41 41 $_POST['link_id'] = $link_id; 42 return wp_update_link( $_POST );42 return wp_update_link( $_POST ); 43 43 } else { 44 return wp_insert_link( $_POST );45 } 46 } 47 48 /** 49 * {@internal Missing Short Description}}50 * 51 * @since unknown52 * 53 * @return unknown44 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 54 54 */ 55 55 function get_default_link_to_edit() { 56 56 if ( isset( $_GET['linkurl'] ) ) 57 $link->link_url = esc_url( $_GET['linkurl'] );57 $link->link_url = esc_url( $_GET['linkurl'] ); 58 58 else 59 59 $link->link_url = ''; 60 60 61 61 if ( isset( $_GET['name'] ) ) 62 $link->link_name = esc_attr( $_GET['name'] );62 $link->link_name = esc_attr( $_GET['name'] ); 63 63 else 64 64 $link->link_name = ''; … … 70 70 71 71 /** 72 * {@internal Missing Short Description}}73 * 74 * @since unknown75 * 76 * @param unknown_type $link_id77 * @return unknown72 * 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 78 78 */ 79 79 function wp_delete_link( $link_id ) { … … 94 94 95 95 /** 96 * {@internal Missing Short Description}}97 * 98 * @since unknown99 * 100 * @param unknown_type $link_id101 * @return unknown96 * 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 102 102 */ 103 103 function wp_get_link_cats( $link_id = 0 ) { … … 109 109 110 110 /** 111 * {@internal Missing Short Description}}112 * 113 * @since unknown114 * 115 * @param unknown_type $link_id116 * @return unknown111 * 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 117 117 */ 118 118 function get_link_to_edit( $link_id ) { … … 121 121 122 122 /** 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. 129 130 */ 130 131 function wp_insert_link( $linkdata, $wp_error = false ) { … … 182 183 183 184 // 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 ) ) { 185 186 $link_category = array( get_option( 'default_link_category' ) ); 186 187 } … … 216 217 217 218 /** 218 * {@internal Missing Short Description}}219 * 220 * @since unknown221 * 222 * @param unknown_type $link_id223 * @param unknown_type $link_categories219 * 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 224 225 */ 225 226 function wp_set_link_cats( $link_id = 0, $link_categories = array() ) { … … 234 235 235 236 clean_bookmark_cache( $link_id ); 236 } // wp_set_link_cats()237 238 /** 239 * {@internal Missing Short Description}}240 * 241 * @since unknown242 * 243 * @param unknown_type $linkdata244 * @return unknown237 } 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. 245 246 */ 246 247 function wp_update_link( $linkdata ) {
Note: See TracChangeset
for help on using the changeset viewer.