]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/bookmark.php
WordPress 4.3
[autoinstalls/wordpress.git] / wp-includes / bookmark.php
index ec2f0b21021a6ab5a01657ddd7319f995f3bbbe6..1e178f436f58ca6a3a524065aad929bebbdd0bf3 100644 (file)
  * Retrieve Bookmark data
  *
  * @since 2.1.0
- * @uses $wpdb Database Object
  *
- * @param mixed $bookmark
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
+ * @param int|stdClass $bookmark
  * @param string $output Optional. Either OBJECT, ARRAY_N, or ARRAY_A constant
  * @param string $filter Optional, default is 'raw'.
- * @return array|object Type returned depends on $output value.
+ * @return array|object|null Type returned depends on $output value.
  */
 function get_bookmark($bookmark, $output = OBJECT, $filter = 'raw') {
        global $wpdb;
@@ -60,13 +61,11 @@ function get_bookmark($bookmark, $output = OBJECT, $filter = 'raw') {
  * Retrieve single bookmark data item or field.
  *
  * @since 2.3.0
- * @uses get_bookmark() Gets bookmark object using $bookmark as ID
- * @uses sanitize_bookmark_field() Sanitizes Bookmark field based on $context.
  *
  * @param string $field The name of the data field to return
  * @param int $bookmark The bookmark ID to get field
  * @param string $context Optional. The context of how the field will be used.
- * @return string
+ * @return string|WP_Error
  */
 function get_bookmark_field( $field, $bookmark, $context = 'display' ) {
        $bookmark = (int) $bookmark;
@@ -93,7 +92,7 @@ function get_bookmark_field( $field, $bookmark, $context = 'display' ) {
  *
  * @since 2.1.0
  *
- * @global wpdb $wpdb WordPress database access abstraction object.
+ * @global wpdb $wpdb WordPress database abstraction object.
  *
  * @param string|array $args {
  *     Optional. String or array of arguments to retrieve bookmarks.
@@ -250,7 +249,7 @@ function get_bookmarks( $args = '' ) {
                        break;
                default:
                        $orderparams = array();
-                       $keys = array( 'link_id', 'link_name', 'link_url', 'link_visible', 'link_rating', 'link_owner', 'link_updated', 'link_notes' );
+                       $keys = array( 'link_id', 'link_name', 'link_url', 'link_visible', 'link_rating', 'link_owner', 'link_updated', 'link_notes', 'link_description' );
                        foreach ( explode( ',', $orderby ) as $ordparam ) {
                                $ordparam = trim( $ordparam );
 
@@ -387,17 +386,18 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
                } else {
                        $value = esc_attr($value);
                }
-       } else if ( 'db' == $context ) {
+       } elseif ( 'db' == $context ) {
                /** This filter is documented in wp-includes/post.php */
                $value = apply_filters( "pre_$field", $value );
        } else {
                /** This filter is documented in wp-includes/post.php */
                $value = apply_filters( $field, $value, $bookmark_id, $context );
 
-               if ( 'attribute' == $context )
-                       $value = esc_attr($value);
-               else if ( 'js' == $context )
-                       $value = esc_js($value);
+               if ( 'attribute' == $context ) {
+                       $value = esc_attr( $value );
+               } elseif ( 'js' == $context ) {
+                       $value = esc_js( $value );
+               }
        }
 
        return $value;
@@ -407,7 +407,6 @@ function sanitize_bookmark_field($field, $value, $bookmark_id, $context) {
  * Deletes bookmark cache
  *
  * @since 2.7.0
- * @uses wp_cache_delete() Deletes the contents of 'get_bookmarks'
  */
 function clean_bookmark_cache( $bookmark_id ) {
        wp_cache_delete( $bookmark_id, 'bookmark' );