WordPress.org

Make WordPress Core

Ticket #19890: 19890.2.diff

File 19890.2.diff, 882 bytes (added by stevenkword, 6 years ago)

Doc added

  • src/wp-includes/functions.php

     
    537537                }
    538538        }
    539539
     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         */
     550        $post_links = apply_filters( 'enclosure_links', $post_links );
     551
    540552        foreach ( (array) $post_links as $url ) {
    541553                if ( $url != '' && !$wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post_ID, $wpdb->esc_like( $url ) . '%' ) ) ) {
    542554