- if ( is_array($cache) && isset( $cache[ $key ] ) )
- return apply_filters('get_bookmarks', $cache[ $key ], $r );
+ if ( is_array($cache) && isset( $cache[ $key ] ) ) {
+ $bookmarks = $cache[ $key ];
+ /**
+ * Filter the returned list of bookmarks.
+ *
+ * The first time the hook is evaluated in this file, it returns the cached
+ * bookmarks list. The second evaluation returns a cached bookmarks list if the
+ * link category is passed but does not exist. The third evaluation returns
+ * the full cached results.
+ *
+ * @since 2.1.0
+ *
+ * @see get_bookmarks()
+ *
+ * @param array $bookmarks List of the cached bookmarks.
+ * @param array $r An array of bookmark query arguments.
+ */
+ return apply_filters( 'get_bookmarks', $bookmarks, $r );
+ }