WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
929 | * |
930 | * Allows for the addition and/or removal of potential enclosures to save |
931 | * to postmeta before checking the database for existing enclosures. |
932 | * |
933 | * @since 4.4.0 |
934 | * |
935 | * @param string[] $post_links An array of enclosure links. |
936 | * @param int $post_id Post ID. |
937 | */ |
938 | $post_links = apply_filters( 'enclosure_links', $post_links, $post->ID ); |
939 |
|
940 | foreach ( (array) $post_links as $url ) { |
941 | $url = strip_fragment_from_url( $url ); |
942 |
|
943 | 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 ) . '%' ) ) ) { |
944 |
|
945 | $headers = wp_get_http_headers( $url ); |
946 | if ( $headers ) { |
947 | $len = isset( $headers['Content-Length'] ) ? (int) $headers['Content-Length'] : 0; |