Enclosure cleanups

git-svn-id: https://develop.svn.wordpress.org/trunk@2288 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg
2005-02-12 08:58:10 +00:00
parent 2f20c8331b
commit fd66fc02c6
5 changed files with 52 additions and 30 deletions

View File

@@ -527,6 +527,25 @@ function get_pung($post_id) { // Get URIs already pung for a post
return $pung;
}
function get_enclosed($post_id) { // Get enclosures already enclosed for a post
global $wpdb;
$custom_fields = get_post_custom( $post_id );
$pung = array();
if( is_array( $custom_fields ) ) {
while( list( $key, $val ) = each( $custom_fields ) ) {
if( $key == 'enclosure' ) {
if (is_array($val)) {
foreach($val as $enc) {
$enclosure = split( "\n", $enc );
$pung[] = trim( $enclosure[ 0 ] );
}
}
}
}
}
return $pung;
}
function get_to_ping($post_id) { // Get any URIs in the todo list
global $wpdb;
$to_ping = $wpdb->get_var("SELECT to_ping FROM $wpdb->posts WHERE ID = $post_id");