| 463 | | foreach ( (array) get_post_custom() as $key => $val) { |
| 464 | | if ($key == 'enclosure') { |
| 465 | | foreach ( (array) $val as $enc ) { |
| 466 | | $enclosure = explode("\n", $enc); |
| 467 | | |
| 468 | | // only get the first element, e.g. audio/mpeg from 'audio/mpeg mpga mp2 mp3' |
| 469 | | $t = preg_split('/[ \t]/', trim($enclosure[2]) ); |
| 470 | | $type = $t[0]; |
| 471 | | |
| 472 | | /** |
| 473 | | * Filters the RSS enclosure HTML link tag for the current post. |
| 474 | | * |
| 475 | | * @since 2.2.0 |
| 476 | | * |
| 477 | | * @param string $html_link_tag The HTML link tag with a URI and other attributes. |
| 478 | | */ |
| 479 | | echo apply_filters( 'rss_enclosure', '<enclosure url="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" length="' . trim( $enclosure[1] ) . '" type="' . $type . '" />' . "\n" ); |
| 480 | | } |
| | 463 | $meta_enclosures = get_post_meta( get_the_ID(), 'enclosure', false ); |
| | 464 | |
| | 465 | foreach ( (array) $meta_enclosures as $key => $val ){ |
| | 466 | foreach ( (array) $val as $enc ) { |
| | 467 | $enclosure = explode("\n", $enc); |
| | 468 | |
| | 469 | // only get the first element, e.g. audio/mpeg from 'audio/mpeg mpga mp2 mp3' |
| | 470 | $t = preg_split('/[ \t]/', trim($enclosure[2]) ); |
| | 471 | $type = $t[0]; |
| | 472 | |
| | 473 | /** |
| | 474 | * Filters the RSS enclosure HTML link tag for the current post. |
| | 475 | * |
| | 476 | * @since 2.2.0 |
| | 477 | * |
| | 478 | * @param string $html_link_tag The HTML link tag with a URI and other attributes. |
| | 479 | */ |
| | 480 | echo apply_filters( 'rss_enclosure', '<enclosure url="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" length="' . trim( $enclosure[1] ) . '" type="' . $type . '" />' . "\n" ); |
| 502 | | foreach ( (array) get_post_custom() as $key => $val ) { |
| 503 | | if ($key == 'enclosure') { |
| 504 | | foreach ( (array) $val as $enc ) { |
| 505 | | $enclosure = explode("\n", $enc); |
| 506 | | /** |
| 507 | | * Filters the atom enclosure HTML link tag for the current post. |
| 508 | | * |
| 509 | | * @since 2.2.0 |
| 510 | | * |
| 511 | | * @param string $html_link_tag The HTML link tag with a URI and other attributes. |
| 512 | | */ |
| 513 | | echo apply_filters( 'atom_enclosure', '<link href="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" rel="enclosure" length="' . trim( $enclosure[1] ) . '" type="' . trim( $enclosure[2] ) . '" />' . "\n" ); |
| 514 | | } |
| | 502 | $meta_enclosures = get_post_meta( get_the_ID(), 'enclosure', false ); |
| | 503 | |
| | 504 | foreach ( (array) $meta_enclosures as $key => $val ){ |
| | 505 | foreach ( (array) $val as $enc ) { |
| | 506 | $enclosure = explode("\n", $enc); |
| | 507 | /** |
| | 508 | * Filters the atom enclosure HTML link tag for the current post. |
| | 509 | * |
| | 510 | * @since 2.2.0 |
| | 511 | * |
| | 512 | * @param string $html_link_tag The HTML link tag with a URI and other attributes. |
| | 513 | */ |
| | 514 | echo apply_filters( 'atom_enclosure', '<link href="' . trim( htmlspecialchars( $enclosure[0] ) ) . '" rel="enclosure" length="' . trim( $enclosure[1] ) . '" type="' . trim( $enclosure[2] ) . '" />' . "\n" ); |