Make WordPress Core

Changeset 35288


Ignore:
Timestamp:
10/20/2015 07:08:59 AM (9 years ago)
Author:
DrewAPicture
Message:

Media: Introduce the enclosure_links filter, which makes it possible to adjust the list of audio and video enclosure links derived from post content before querying the database.

Props niallkennedy, stevenkword.
Fixes #19890.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r35276 r35288  
    537537        }
    538538    }
     539
     540    /**
     541     * Filter the list of enclosure links before querying the database.
     542     *
     543     * Allows for the addition and/or removal of potential enclosures to save
     544     * to postmeta before checking the database for existing enclosures.
     545     *
     546     * @since 4.4.0
     547     *
     548     * @param array $post_links An array of enclosure links.
     549     * @param int   $post_ID    Post ID.
     550     */
     551    $post_links = apply_filters( 'enclosure_links', $post_links, $post_ID );
    539552
    540553    foreach ( (array) $post_links as $url ) {
Note: See TracChangeset for help on using the changeset viewer.