]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/bookmark.php
WordPress 4.5-scripts
[autoinstalls/wordpress.git] / wp-includes / bookmark.php
index 08b21297732fc17d9025f5ab4911dee1a1523868..140f5fdc48bb66aa0131a56f183c91fdc06cc500 100644 (file)
@@ -16,7 +16,7 @@
  * @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;
@@ -65,7 +65,7 @@ function get_bookmark($bookmark, $output = OBJECT, $filter = 'raw') {
  * @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;
@@ -386,26 +386,29 @@ 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;
 }
 
 /**
- * Deletes bookmark cache
+ * Deletes the bookmark cache.
  *
  * @since 2.7.0
+ *
+ * @param int $bookmark_id Bookmark ID.
  */
 function clean_bookmark_cache( $bookmark_id ) {
        wp_cache_delete( $bookmark_id, 'bookmark' );