Edit File by line
/home/barbar84/public_h.../wp-inclu...
File: feed.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* WordPress Feed API
[2] Fix | Delete
*
[3] Fix | Delete
* Many of the functions used in here belong in The Loop, or The Loop for the
[4] Fix | Delete
* Feeds.
[5] Fix | Delete
*
[6] Fix | Delete
* @package WordPress
[7] Fix | Delete
* @subpackage Feed
[8] Fix | Delete
* @since 2.1.0
[9] Fix | Delete
*/
[10] Fix | Delete
[11] Fix | Delete
/**
[12] Fix | Delete
* RSS container for the bloginfo function.
[13] Fix | Delete
*
[14] Fix | Delete
* You can retrieve anything that you can using the get_bloginfo() function.
[15] Fix | Delete
* Everything will be stripped of tags and characters converted, when the values
[16] Fix | Delete
* are retrieved for use in the feeds.
[17] Fix | Delete
*
[18] Fix | Delete
* @since 1.5.1
[19] Fix | Delete
*
[20] Fix | Delete
* @see get_bloginfo() For the list of possible values to display.
[21] Fix | Delete
*
[22] Fix | Delete
* @param string $show See get_bloginfo() for possible values.
[23] Fix | Delete
* @return string
[24] Fix | Delete
*/
[25] Fix | Delete
function get_bloginfo_rss( $show = '' ) {
[26] Fix | Delete
$info = strip_tags( get_bloginfo( $show ) );
[27] Fix | Delete
/**
[28] Fix | Delete
* Filters the bloginfo for use in RSS feeds.
[29] Fix | Delete
*
[30] Fix | Delete
* @since 2.2.0
[31] Fix | Delete
*
[32] Fix | Delete
* @see convert_chars()
[33] Fix | Delete
* @see get_bloginfo()
[34] Fix | Delete
*
[35] Fix | Delete
* @param string $info Converted string value of the blog information.
[36] Fix | Delete
* @param string $show The type of blog information to retrieve.
[37] Fix | Delete
*/
[38] Fix | Delete
return apply_filters( 'get_bloginfo_rss', convert_chars( $info ), $show );
[39] Fix | Delete
}
[40] Fix | Delete
[41] Fix | Delete
/**
[42] Fix | Delete
* Display RSS container for the bloginfo function.
[43] Fix | Delete
*
[44] Fix | Delete
* You can retrieve anything that you can using the get_bloginfo() function.
[45] Fix | Delete
* Everything will be stripped of tags and characters converted, when the values
[46] Fix | Delete
* are retrieved for use in the feeds.
[47] Fix | Delete
*
[48] Fix | Delete
* @since 0.71
[49] Fix | Delete
*
[50] Fix | Delete
* @see get_bloginfo() For the list of possible values to display.
[51] Fix | Delete
*
[52] Fix | Delete
* @param string $show See get_bloginfo() for possible values.
[53] Fix | Delete
*/
[54] Fix | Delete
function bloginfo_rss( $show = '' ) {
[55] Fix | Delete
/**
[56] Fix | Delete
* Filters the bloginfo for display in RSS feeds.
[57] Fix | Delete
*
[58] Fix | Delete
* @since 2.1.0
[59] Fix | Delete
*
[60] Fix | Delete
* @see get_bloginfo()
[61] Fix | Delete
*
[62] Fix | Delete
* @param string $rss_container RSS container for the blog information.
[63] Fix | Delete
* @param string $show The type of blog information to retrieve.
[64] Fix | Delete
*/
[65] Fix | Delete
echo apply_filters( 'bloginfo_rss', get_bloginfo_rss( $show ), $show );
[66] Fix | Delete
}
[67] Fix | Delete
[68] Fix | Delete
/**
[69] Fix | Delete
* Retrieve the default feed.
[70] Fix | Delete
*
[71] Fix | Delete
* The default feed is 'rss2', unless a plugin changes it through the
[72] Fix | Delete
* {@see 'default_feed'} filter.
[73] Fix | Delete
*
[74] Fix | Delete
* @since 2.5.0
[75] Fix | Delete
*
[76] Fix | Delete
* @return string Default feed, or for example 'rss2', 'atom', etc.
[77] Fix | Delete
*/
[78] Fix | Delete
function get_default_feed() {
[79] Fix | Delete
/**
[80] Fix | Delete
* Filters the default feed type.
[81] Fix | Delete
*
[82] Fix | Delete
* @since 2.5.0
[83] Fix | Delete
*
[84] Fix | Delete
* @param string $feed_type Type of default feed. Possible values include 'rss2', 'atom'.
[85] Fix | Delete
* Default 'rss2'.
[86] Fix | Delete
*/
[87] Fix | Delete
$default_feed = apply_filters( 'default_feed', 'rss2' );
[88] Fix | Delete
[89] Fix | Delete
return ( 'rss' === $default_feed ) ? 'rss2' : $default_feed;
[90] Fix | Delete
}
[91] Fix | Delete
[92] Fix | Delete
/**
[93] Fix | Delete
* Retrieve the blog title for the feed title.
[94] Fix | Delete
*
[95] Fix | Delete
* @since 2.2.0
[96] Fix | Delete
* @since 4.4.0 The optional `$sep` parameter was deprecated and renamed to `$deprecated`.
[97] Fix | Delete
*
[98] Fix | Delete
* @param string $deprecated Unused..
[99] Fix | Delete
* @return string The document title.
[100] Fix | Delete
*/
[101] Fix | Delete
function get_wp_title_rss( $deprecated = '&#8211;' ) {
[102] Fix | Delete
if ( '&#8211;' !== $deprecated ) {
[103] Fix | Delete
/* translators: %s: 'document_title_separator' filter name. */
[104] Fix | Delete
_deprecated_argument( __FUNCTION__, '4.4.0', sprintf( __( 'Use the %s filter instead.' ), '<code>document_title_separator</code>' ) );
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
/**
[108] Fix | Delete
* Filters the blog title for use as the feed title.
[109] Fix | Delete
*
[110] Fix | Delete
* @since 2.2.0
[111] Fix | Delete
* @since 4.4.0 The `$sep` parameter was deprecated and renamed to `$deprecated`.
[112] Fix | Delete
*
[113] Fix | Delete
* @param string $title The current blog title.
[114] Fix | Delete
* @param string $deprecated Unused.
[115] Fix | Delete
*/
[116] Fix | Delete
return apply_filters( 'get_wp_title_rss', wp_get_document_title(), $deprecated );
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
/**
[120] Fix | Delete
* Display the blog title for display of the feed title.
[121] Fix | Delete
*
[122] Fix | Delete
* @since 2.2.0
[123] Fix | Delete
* @since 4.4.0 The optional `$sep` parameter was deprecated and renamed to `$deprecated`.
[124] Fix | Delete
*
[125] Fix | Delete
* @param string $deprecated Unused.
[126] Fix | Delete
*/
[127] Fix | Delete
function wp_title_rss( $deprecated = '&#8211;' ) {
[128] Fix | Delete
if ( '&#8211;' !== $deprecated ) {
[129] Fix | Delete
/* translators: %s: 'document_title_separator' filter name. */
[130] Fix | Delete
_deprecated_argument( __FUNCTION__, '4.4.0', sprintf( __( 'Use the %s filter instead.' ), '<code>document_title_separator</code>' ) );
[131] Fix | Delete
}
[132] Fix | Delete
[133] Fix | Delete
/**
[134] Fix | Delete
* Filters the blog title for display of the feed title.
[135] Fix | Delete
*
[136] Fix | Delete
* @since 2.2.0
[137] Fix | Delete
* @since 4.4.0 The `$sep` parameter was deprecated and renamed to `$deprecated`.
[138] Fix | Delete
*
[139] Fix | Delete
* @see get_wp_title_rss()
[140] Fix | Delete
*
[141] Fix | Delete
* @param string $wp_title_rss The current blog title.
[142] Fix | Delete
* @param string $deprecated Unused.
[143] Fix | Delete
*/
[144] Fix | Delete
echo apply_filters( 'wp_title_rss', get_wp_title_rss(), $deprecated );
[145] Fix | Delete
}
[146] Fix | Delete
[147] Fix | Delete
/**
[148] Fix | Delete
* Retrieve the current post title for the feed.
[149] Fix | Delete
*
[150] Fix | Delete
* @since 2.0.0
[151] Fix | Delete
*
[152] Fix | Delete
* @return string Current post title.
[153] Fix | Delete
*/
[154] Fix | Delete
function get_the_title_rss() {
[155] Fix | Delete
$title = get_the_title();
[156] Fix | Delete
[157] Fix | Delete
/**
[158] Fix | Delete
* Filters the post title for use in a feed.
[159] Fix | Delete
*
[160] Fix | Delete
* @since 1.2.0
[161] Fix | Delete
*
[162] Fix | Delete
* @param string $title The current post title.
[163] Fix | Delete
*/
[164] Fix | Delete
return apply_filters( 'the_title_rss', $title );
[165] Fix | Delete
}
[166] Fix | Delete
[167] Fix | Delete
/**
[168] Fix | Delete
* Display the post title in the feed.
[169] Fix | Delete
*
[170] Fix | Delete
* @since 0.71
[171] Fix | Delete
*/
[172] Fix | Delete
function the_title_rss() {
[173] Fix | Delete
echo get_the_title_rss();
[174] Fix | Delete
}
[175] Fix | Delete
[176] Fix | Delete
/**
[177] Fix | Delete
* Retrieve the post content for feeds.
[178] Fix | Delete
*
[179] Fix | Delete
* @since 2.9.0
[180] Fix | Delete
*
[181] Fix | Delete
* @see get_the_content()
[182] Fix | Delete
*
[183] Fix | Delete
* @param string $feed_type The type of feed. rss2 | atom | rss | rdf
[184] Fix | Delete
* @return string The filtered content.
[185] Fix | Delete
*/
[186] Fix | Delete
function get_the_content_feed( $feed_type = null ) {
[187] Fix | Delete
if ( ! $feed_type ) {
[188] Fix | Delete
$feed_type = get_default_feed();
[189] Fix | Delete
}
[190] Fix | Delete
[191] Fix | Delete
/** This filter is documented in wp-includes/post-template.php */
[192] Fix | Delete
$content = apply_filters( 'the_content', get_the_content() );
[193] Fix | Delete
$content = str_replace( ']]>', ']]&gt;', $content );
[194] Fix | Delete
[195] Fix | Delete
/**
[196] Fix | Delete
* Filters the post content for use in feeds.
[197] Fix | Delete
*
[198] Fix | Delete
* @since 2.9.0
[199] Fix | Delete
*
[200] Fix | Delete
* @param string $content The current post content.
[201] Fix | Delete
* @param string $feed_type Type of feed. Possible values include 'rss2', 'atom'.
[202] Fix | Delete
* Default 'rss2'.
[203] Fix | Delete
*/
[204] Fix | Delete
return apply_filters( 'the_content_feed', $content, $feed_type );
[205] Fix | Delete
}
[206] Fix | Delete
[207] Fix | Delete
/**
[208] Fix | Delete
* Display the post content for feeds.
[209] Fix | Delete
*
[210] Fix | Delete
* @since 2.9.0
[211] Fix | Delete
*
[212] Fix | Delete
* @param string $feed_type The type of feed. rss2 | atom | rss | rdf
[213] Fix | Delete
*/
[214] Fix | Delete
function the_content_feed( $feed_type = null ) {
[215] Fix | Delete
echo get_the_content_feed( $feed_type );
[216] Fix | Delete
}
[217] Fix | Delete
[218] Fix | Delete
/**
[219] Fix | Delete
* Display the post excerpt for the feed.
[220] Fix | Delete
*
[221] Fix | Delete
* @since 0.71
[222] Fix | Delete
*/
[223] Fix | Delete
function the_excerpt_rss() {
[224] Fix | Delete
$output = get_the_excerpt();
[225] Fix | Delete
/**
[226] Fix | Delete
* Filters the post excerpt for a feed.
[227] Fix | Delete
*
[228] Fix | Delete
* @since 1.2.0
[229] Fix | Delete
*
[230] Fix | Delete
* @param string $output The current post excerpt.
[231] Fix | Delete
*/
[232] Fix | Delete
echo apply_filters( 'the_excerpt_rss', $output );
[233] Fix | Delete
}
[234] Fix | Delete
[235] Fix | Delete
/**
[236] Fix | Delete
* Display the permalink to the post for use in feeds.
[237] Fix | Delete
*
[238] Fix | Delete
* @since 2.3.0
[239] Fix | Delete
*/
[240] Fix | Delete
function the_permalink_rss() {
[241] Fix | Delete
/**
[242] Fix | Delete
* Filters the permalink to the post for use in feeds.
[243] Fix | Delete
*
[244] Fix | Delete
* @since 2.3.0
[245] Fix | Delete
*
[246] Fix | Delete
* @param string $post_permalink The current post permalink.
[247] Fix | Delete
*/
[248] Fix | Delete
echo esc_url( apply_filters( 'the_permalink_rss', get_permalink() ) );
[249] Fix | Delete
}
[250] Fix | Delete
[251] Fix | Delete
/**
[252] Fix | Delete
* Outputs the link to the comments for the current post in an xml safe way
[253] Fix | Delete
*
[254] Fix | Delete
* @since 3.0.0
[255] Fix | Delete
*/
[256] Fix | Delete
function comments_link_feed() {
[257] Fix | Delete
/**
[258] Fix | Delete
* Filters the comments permalink for the current post.
[259] Fix | Delete
*
[260] Fix | Delete
* @since 3.6.0
[261] Fix | Delete
*
[262] Fix | Delete
* @param string $comment_permalink The current comment permalink with
[263] Fix | Delete
* '#comments' appended.
[264] Fix | Delete
*/
[265] Fix | Delete
echo esc_url( apply_filters( 'comments_link_feed', get_comments_link() ) );
[266] Fix | Delete
}
[267] Fix | Delete
[268] Fix | Delete
/**
[269] Fix | Delete
* Display the feed GUID for the current comment.
[270] Fix | Delete
*
[271] Fix | Delete
* @since 2.5.0
[272] Fix | Delete
*
[273] Fix | Delete
* @param int|WP_Comment $comment_id Optional comment object or ID. Defaults to global comment object.
[274] Fix | Delete
*/
[275] Fix | Delete
function comment_guid( $comment_id = null ) {
[276] Fix | Delete
echo esc_url( get_comment_guid( $comment_id ) );
[277] Fix | Delete
}
[278] Fix | Delete
[279] Fix | Delete
/**
[280] Fix | Delete
* Retrieve the feed GUID for the current comment.
[281] Fix | Delete
*
[282] Fix | Delete
* @since 2.5.0
[283] Fix | Delete
*
[284] Fix | Delete
* @param int|WP_Comment $comment_id Optional comment object or ID. Defaults to global comment object.
[285] Fix | Delete
* @return string|false GUID for comment on success, false on failure.
[286] Fix | Delete
*/
[287] Fix | Delete
function get_comment_guid( $comment_id = null ) {
[288] Fix | Delete
$comment = get_comment( $comment_id );
[289] Fix | Delete
[290] Fix | Delete
if ( ! is_object( $comment ) ) {
[291] Fix | Delete
return false;
[292] Fix | Delete
}
[293] Fix | Delete
[294] Fix | Delete
return get_the_guid( $comment->comment_post_ID ) . '#comment-' . $comment->comment_ID;
[295] Fix | Delete
}
[296] Fix | Delete
[297] Fix | Delete
/**
[298] Fix | Delete
* Display the link to the comments.
[299] Fix | Delete
*
[300] Fix | Delete
* @since 1.5.0
[301] Fix | Delete
* @since 4.4.0 Introduced the `$comment` argument.
[302] Fix | Delete
*
[303] Fix | Delete
* @param int|WP_Comment $comment Optional. Comment object or ID. Defaults to global comment object.
[304] Fix | Delete
*/
[305] Fix | Delete
function comment_link( $comment = null ) {
[306] Fix | Delete
/**
[307] Fix | Delete
* Filters the current comment's permalink.
[308] Fix | Delete
*
[309] Fix | Delete
* @since 3.6.0
[310] Fix | Delete
*
[311] Fix | Delete
* @see get_comment_link()
[312] Fix | Delete
*
[313] Fix | Delete
* @param string $comment_permalink The current comment permalink.
[314] Fix | Delete
*/
[315] Fix | Delete
echo esc_url( apply_filters( 'comment_link', get_comment_link( $comment ) ) );
[316] Fix | Delete
}
[317] Fix | Delete
[318] Fix | Delete
/**
[319] Fix | Delete
* Retrieve the current comment author for use in the feeds.
[320] Fix | Delete
*
[321] Fix | Delete
* @since 2.0.0
[322] Fix | Delete
*
[323] Fix | Delete
* @return string Comment Author
[324] Fix | Delete
*/
[325] Fix | Delete
function get_comment_author_rss() {
[326] Fix | Delete
/**
[327] Fix | Delete
* Filters the current comment author for use in a feed.
[328] Fix | Delete
*
[329] Fix | Delete
* @since 1.5.0
[330] Fix | Delete
*
[331] Fix | Delete
* @see get_comment_author()
[332] Fix | Delete
*
[333] Fix | Delete
* @param string $comment_author The current comment author.
[334] Fix | Delete
*/
[335] Fix | Delete
return apply_filters( 'comment_author_rss', get_comment_author() );
[336] Fix | Delete
}
[337] Fix | Delete
[338] Fix | Delete
/**
[339] Fix | Delete
* Display the current comment author in the feed.
[340] Fix | Delete
*
[341] Fix | Delete
* @since 1.0.0
[342] Fix | Delete
*/
[343] Fix | Delete
function comment_author_rss() {
[344] Fix | Delete
echo get_comment_author_rss();
[345] Fix | Delete
}
[346] Fix | Delete
[347] Fix | Delete
/**
[348] Fix | Delete
* Display the current comment content for use in the feeds.
[349] Fix | Delete
*
[350] Fix | Delete
* @since 1.0.0
[351] Fix | Delete
*/
[352] Fix | Delete
function comment_text_rss() {
[353] Fix | Delete
$comment_text = get_comment_text();
[354] Fix | Delete
/**
[355] Fix | Delete
* Filters the current comment content for use in a feed.
[356] Fix | Delete
*
[357] Fix | Delete
* @since 1.5.0
[358] Fix | Delete
*
[359] Fix | Delete
* @param string $comment_text The content of the current comment.
[360] Fix | Delete
*/
[361] Fix | Delete
$comment_text = apply_filters( 'comment_text_rss', $comment_text );
[362] Fix | Delete
echo $comment_text;
[363] Fix | Delete
}
[364] Fix | Delete
[365] Fix | Delete
/**
[366] Fix | Delete
* Retrieve all of the post categories, formatted for use in feeds.
[367] Fix | Delete
*
[368] Fix | Delete
* All of the categories for the current post in the feed loop, will be
[369] Fix | Delete
* retrieved and have feed markup added, so that they can easily be added to the
[370] Fix | Delete
* RSS2, Atom, or RSS1 and RSS0.91 RDF feeds.
[371] Fix | Delete
*
[372] Fix | Delete
* @since 2.1.0
[373] Fix | Delete
*
[374] Fix | Delete
* @param string $type Optional, default is the type returned by get_default_feed().
[375] Fix | Delete
* @return string All of the post categories for displaying in the feed.
[376] Fix | Delete
*/
[377] Fix | Delete
function get_the_category_rss( $type = null ) {
[378] Fix | Delete
if ( empty( $type ) ) {
[379] Fix | Delete
$type = get_default_feed();
[380] Fix | Delete
}
[381] Fix | Delete
$categories = get_the_category();
[382] Fix | Delete
$tags = get_the_tags();
[383] Fix | Delete
$the_list = '';
[384] Fix | Delete
$cat_names = array();
[385] Fix | Delete
[386] Fix | Delete
$filter = 'rss';
[387] Fix | Delete
if ( 'atom' === $type ) {
[388] Fix | Delete
$filter = 'raw';
[389] Fix | Delete
}
[390] Fix | Delete
[391] Fix | Delete
if ( ! empty( $categories ) ) {
[392] Fix | Delete
foreach ( (array) $categories as $category ) {
[393] Fix | Delete
$cat_names[] = sanitize_term_field( 'name', $category->name, $category->term_id, 'category', $filter );
[394] Fix | Delete
}
[395] Fix | Delete
}
[396] Fix | Delete
[397] Fix | Delete
if ( ! empty( $tags ) ) {
[398] Fix | Delete
foreach ( (array) $tags as $tag ) {
[399] Fix | Delete
$cat_names[] = sanitize_term_field( 'name', $tag->name, $tag->term_id, 'post_tag', $filter );
[400] Fix | Delete
}
[401] Fix | Delete
}
[402] Fix | Delete
[403] Fix | Delete
$cat_names = array_unique( $cat_names );
[404] Fix | Delete
[405] Fix | Delete
foreach ( $cat_names as $cat_name ) {
[406] Fix | Delete
if ( 'rdf' === $type ) {
[407] Fix | Delete
$the_list .= "\t\t<dc:subject><![CDATA[$cat_name]]></dc:subject>\n";
[408] Fix | Delete
} elseif ( 'atom' === $type ) {
[409] Fix | Delete
$the_list .= sprintf( '<category scheme="%1$s" term="%2$s" />', esc_attr( get_bloginfo_rss( 'url' ) ), esc_attr( $cat_name ) );
[410] Fix | Delete
} else {
[411] Fix | Delete
$the_list .= "\t\t<category><![CDATA[" . html_entity_decode( $cat_name, ENT_COMPAT, get_option( 'blog_charset' ) ) . "]]></category>\n";
[412] Fix | Delete
}
[413] Fix | Delete
}
[414] Fix | Delete
[415] Fix | Delete
/**
[416] Fix | Delete
* Filters all of the post categories for display in a feed.
[417] Fix | Delete
*
[418] Fix | Delete
* @since 1.2.0
[419] Fix | Delete
*
[420] Fix | Delete
* @param string $the_list All of the RSS post categories.
[421] Fix | Delete
* @param string $type Type of feed. Possible values include 'rss2', 'atom'.
[422] Fix | Delete
* Default 'rss2'.
[423] Fix | Delete
*/
[424] Fix | Delete
return apply_filters( 'the_category_rss', $the_list, $type );
[425] Fix | Delete
}
[426] Fix | Delete
[427] Fix | Delete
/**
[428] Fix | Delete
* Display the post categories in the feed.
[429] Fix | Delete
*
[430] Fix | Delete
* @since 0.71
[431] Fix | Delete
*
[432] Fix | Delete
* @see get_the_category_rss() For better explanation.
[433] Fix | Delete
*
[434] Fix | Delete
* @param string $type Optional, default is the type returned by get_default_feed().
[435] Fix | Delete
*/
[436] Fix | Delete
function the_category_rss( $type = null ) {
[437] Fix | Delete
echo get_the_category_rss( $type );
[438] Fix | Delete
}
[439] Fix | Delete
[440] Fix | Delete
/**
[441] Fix | Delete
* Display the HTML type based on the blog setting.
[442] Fix | Delete
*
[443] Fix | Delete
* The two possible values are either 'xhtml' or 'html'.
[444] Fix | Delete
*
[445] Fix | Delete
* @since 2.2.0
[446] Fix | Delete
*/
[447] Fix | Delete
function html_type_rss() {
[448] Fix | Delete
$type = get_bloginfo( 'html_type' );
[449] Fix | Delete
if ( strpos( $type, 'xhtml' ) !== false ) {
[450] Fix | Delete
$type = 'xhtml';
[451] Fix | Delete
} else {
[452] Fix | Delete
$type = 'html';
[453] Fix | Delete
}
[454] Fix | Delete
echo $type;
[455] Fix | Delete
}
[456] Fix | Delete
[457] Fix | Delete
/**
[458] Fix | Delete
* Display the rss enclosure for the current post.
[459] Fix | Delete
*
[460] Fix | Delete
* Uses the global $post to check whether the post requires a password and if
[461] Fix | Delete
* the user has the password for the post. If not then it will return before
[462] Fix | Delete
* displaying.
[463] Fix | Delete
*
[464] Fix | Delete
* Also uses the function get_post_custom() to get the post's 'enclosure'
[465] Fix | Delete
* metadata field and parses the value to display the enclosure(s). The
[466] Fix | Delete
* enclosure(s) consist of enclosure HTML tag(s) with a URI and other
[467] Fix | Delete
* attributes.
[468] Fix | Delete
*
[469] Fix | Delete
* @since 1.5.0
[470] Fix | Delete
*/
[471] Fix | Delete
function rss_enclosure() {
[472] Fix | Delete
if ( post_password_required() ) {
[473] Fix | Delete
return;
[474] Fix | Delete
}
[475] Fix | Delete
[476] Fix | Delete
foreach ( (array) get_post_custom() as $key => $val ) {
[477] Fix | Delete
if ( 'enclosure' === $key ) {
[478] Fix | Delete
foreach ( (array) $val as $enc ) {
[479] Fix | Delete
$enclosure = explode( "\n", $enc );
[480] Fix | Delete
[481] Fix | Delete
// Only get the first element, e.g. 'audio/mpeg' from 'audio/mpeg mpga mp2 mp3'.
[482] Fix | Delete
$t = preg_split( '/[ \t]/', trim( $enclosure[2] ) );
[483] Fix | Delete
$type = $t[0];
[484] Fix | Delete
[485] Fix | Delete
/**
[486] Fix | Delete
* Filters the RSS enclosure HTML link tag for the current post.
[487] Fix | Delete
*
[488] Fix | Delete
* @since 2.2.0
[489] Fix | Delete
*
[490] Fix | Delete
* @param string $html_link_tag The HTML link tag with a URI and other attributes.
[491] Fix | Delete
*/
[492] Fix | Delete
echo apply_filters( 'rss_enclosure', '<enclosure url="' . esc_url( trim( $enclosure[0] ) ) . '" length="' . absint( trim( $enclosure[1] ) ) . '" type="' . esc_attr( $type ) . '" />' . "\n" );
[493] Fix | Delete
}
[494] Fix | Delete
}
[495] Fix | Delete
}
[496] Fix | Delete
}
[497] Fix | Delete
[498] Fix | Delete
/**
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function