WordPress.org

Make WordPress Core

Changeset 31867


Ignore:
Timestamp:
03/23/2015 05:23:27 PM (5 years ago)
Author:
azaozz
Message:

Introduce attachment_url_to_postid filter to let plugins manage the uploads location better.
Props mattwiebe. Fixes #31717.

File:
1 edited

Legend:

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

    r31851 r31867  
    34103410    $post_id = $wpdb->get_var( $sql );
    34113411
     3412    /**
     3413     * Filter an attachment id found by URL.
     3414     *
     3415     * @since 4.2.0
     3416     *
     3417     * @param int|null $post_id  The post_id (if any) found by the function.
     3418     * @param string   $url      The URL being looked up.
     3419     */
     3420    $post_id = apply_filters( 'attachment_url_to_postid', $post_id, $url );
     3421
    34123422    return (int) $post_id;
    34133423}
Note: See TracChangeset for help on using the changeset viewer.