Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




get_enclosed [ WordPress Function ]

get_enclosed ( $post_id )
Parameters:
  • (int) $post_id Post ID.
Uses:
  • $wpdb
Returns:
  • (array) List of enclosures
Defined at:



Retrieve enclosures already enclosed for a post.

Source


<?php
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 explode"\n"$enc );
            
$pung[] = trim$enclosure] );
        }
    }
    
$pung apply_filters('get_enclosed'$pung$post_id);
    return 
$pung;
}
?>

Examples [ wp-snippets.com ]

Google Arama Sonuçlarý

Dahasý ...

Kullanýcý Tartýþmalarý [ wordpress.org ]

- Bulunamadý -

Yeni bir konu yaz ...

0 User Note(s)

Henüz yok. Ýlk sen ol!

Yeni Ekle ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics