Advertisements

get_enclosed

Definition:
function get_enclosed($post_id) {}

Retrieve enclosures already enclosed for a post.

Parameters

  • int $post_id: Post ID.

Return values

returns:List of enclosures

Defined filters

  • get_enclosed
    apply_filters('get_enclosed', $pung, $post_id)

Source code

function get_enclosed($post_id) {

	$custom_fields = get_post_custom( $post_id );

	$pung = array();

	if ( !is_array( $custom_fields ) )

		return $pung;



	foreach ( $custom_fields as $key => $val ) {

		if ( 'enclosure' != $key || !is_array( $val ) )

			continue;

		foreach( $val as $enc ) {

			$enclosure = split( "\n", $enc );

			$pung[] = trim( $enclosure[ 0 ] );

		}

	}

	$pung = apply_filters('get_enclosed', $pung, $post_id);

	return $pung;

}

1384

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: