Make WordPress Core

Ticket #25468: 25468.2.diff

File 25468.2.diff, 2.5 KB (added by DrewAPicture, 10 years ago)

fixed duplicate tags

  • src/wp-includes/bookmark.php

     
    136136        $key = md5( serialize( $r ) );
    137137        if ( $cache = wp_cache_get( 'get_bookmarks', 'bookmark' ) ) {
    138138                if ( is_array($cache) && isset( $cache[ $key ] ) )
    139                         return apply_filters('get_bookmarks', $cache[ $key ], $r );
     139                        $bookmarks = $cache[ $key ];
     140                        /**
     141                         * Filter the returned list of bookmarks.
     142                         *
     143                         * The first time the hook is evaluated in this file, it returns the cached
     144                         * bookmarks list. The second evaluation returns a cached bookmarks list if the
     145                         * link category is passed but does not exist. The third evaluation returns
     146                         * the full cached results.
     147                         *
     148                         * @since 2.1.0
     149                         *
     150                         * @see get_bookmarks()
     151                         *
     152                         * @param array $bookmarks List of the cached bookmarks.
     153                         * @param array $r         An array of bookmark query arguments.
     154                         */
     155                        return apply_filters( 'get_bookmarks', $bookmarks, $r );
    140156        }
    141157
    142158        if ( !is_array($cache) )
     
    181197                } else {
    182198                        $cache[ $key ] = array();
    183199                        wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
     200                        /** This filter is documented in wp-includes/bookmark.php */
    184201                        return apply_filters( 'get_bookmarks', array(), $r );
    185202                }
    186203        }
     
    263280        $cache[ $key ] = $results;
    264281        wp_cache_set( 'get_bookmarks', $cache, 'bookmark' );
    265282
    266         return apply_filters('get_bookmarks', $results, $r);
     283        /** This filter is documented in wp-includes/bookmark.php */
     284        return apply_filters( 'get_bookmarks', $results, $r );
    267285}
    268286
    269287/**
     
    352370                return $value;
    353371
    354372        if ( 'edit' == $context ) {
    355                 $value = apply_filters("edit_$field", $value, $bookmark_id);
     373                /** This filter is documented in wp-includes/post.php */
     374                $value = apply_filters( "edit_$field", $value, $bookmark_id );
    356375
    357376                if ( 'link_notes' == $field ) {
    358377                        $value = esc_html( $value ); // textarea_escaped
     
    360379                        $value = esc_attr($value);
    361380                }
    362381        } else if ( 'db' == $context ) {
    363                 $value = apply_filters("pre_$field", $value);
     382                /** This filter is documented in wp-includes/post.php */
     383                $value = apply_filters( "pre_$field", $value );
    364384        } else {
    365                 // Use display filters by default.
    366                 $value = apply_filters($field, $value, $bookmark_id, $context);
     385                /** This filter is documented in wp-includes/post.php */
     386                $value = apply_filters( $field, $value, $bookmark_id, $context );
    367387
    368388                if ( 'attribute' == $context )
    369389                        $value = esc_attr($value);