atom_enclosure [ WordPress Function ]
| Uses: | |
| Defined at: |
|
Display the atom enclosure for the current post.
Uses the global $post to check whether the post requires a password and if the user has the password for the post. If not then it will return before displaying.
Also uses the function get_post_custom() to get the post's 'enclosure' metadata field and parses the value to display the enclosure(s). The enclosure(s) consist of link HTML tag(s) with a URI and other attributes.
Source
<?php
function atom_enclosure() {
if ( post_password_required() )
return;
foreach ( (array) get_post_custom() as $key => $val ) {
if ($key == 'enclosure') {
foreach ( (array) $val as $enc ) {
$enclosure = explode("\n", $enc);
echo apply_filters('atom_enclosure', '<link href="' . trim(htmlspecialchars($enclosure[0])) . '" rel="enclosure" length="' . trim($enclosure[1]) . '" type="' . trim($enclosure[2]) . '" />' . "\n");
}
}
}
}
?>
Examples [ wp-snippets.com ]
Top Google zoekresultaten
- Docs for page feed.php
Display the atom enclosure for the current post. ... the current post enclosure metadata. uses: apply_filters() - Calls 'atom_enclosure' hook on atom enclosure.
phpdoc.wordpress.org - #19890 (Filter auto enclosure links before processing) – WordPress ...
Right now do_enclose() finds the mention of the MP3, adds it to post meta, which later outputs in rss_enclosure() or atom_enclosure(). If I want to remove the ...
core.trac.wordpress.org - atom_enclosure() WordPress function reference, arguments and ...
Display the atom enclosure for the current post. Uses the global $post to check whether the post requires a password and if the user has the password for the ...
queryposts.com - /wp-includes/feed.php source - PHP Cross Reference (PHPXRef) of ...
Jun 1, 2011 ... 412 * 413 * @package WordPress 414 * @subpackage Template 415 * @since 2.2.0 416 * @uses apply_filters() Calls 'atom_enclosure' hook ...
xref.yoast.com