get_enclosed
Filters the list of enclosures already enclosed for the given post.
Description
Parameters (2)
- 0. $pung (array)
- Array of enclosures for the given post.
- 1. $post_id (int)
- The post id.
Usage
- To run the hook, copy the example below.
- $pung = apply_filters( 'get_enclosed', $pung, $post_id );
- if ( !empty( $pung ) ) {
- // everything has led up to this point...
- }
- The following example is for adding a hook callback.
- // define the get_enclosed callback
- function filter_get_enclosed( $pung, $post_id ) {
- // make filter magic happen here...
- return $pung;
- };
- // add the filter
- add_filter( 'get_enclosed', 'filter_get_enclosed', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the filter
- remove_filter( 'get_enclosed', 'filter_get_enclosed', 10, 2 );
Defined (1)
The filter is defined in the following location(s).
- /wp-includes/post.php
- return apply_filters( 'get_enclosed', $pung, $post_id );