本文整理汇总了PHP中get_wp_title_rss函数的典型用法代码示例。如果您正苦于以下问题:PHP get_wp_title_rss函数的具体用法?PHP get_wp_title_rss怎么用?PHP get_wp_title_rss使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_wp_title_rss函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_feed_title
/**
* Return feed title.
*
* @return string
*/
function get_feed_title()
{
$info = strip_tags(Settings\get_site_option('title'));
$title = apply_filters('get_bloginfo_rss', convert_chars($info));
if (!$title) {
$title = get_bloginfo_rss('name');
$title .= get_wp_title_rss();
}
return apply_filters('inpsmf_feed_title', $title);
}
示例2: do_action
do_action('atom_ns');
/**
* Fires inside the feed tag in the Atom comment feed.
*
* @since 2.8.0
*/
do_action('atom_comments_ns');
?>
>
<title type="text"><?php
if (is_singular()) {
printf(ent2ncr(__('Comments on %s')), get_the_title_rss());
} elseif (is_search()) {
printf(ent2ncr(__('Comments for %1$s searching on %2$s')), get_bloginfo_rss('name'), get_search_query());
} else {
printf(ent2ncr(__('Comments for %s')), get_wp_title_rss());
}
?>
</title>
<subtitle type="text"><?php
bloginfo_rss('description');
?>
</subtitle>
<updated><?php
echo mysql2date('Y-m-d\\TH:i:s\\Z', get_lastcommentmodified('GMT'), false);
?>
</updated>
<?php
if (is_singular()) {
示例3: wp_title_rss
/**
* Display the blog title for display of the feed title.
*
* @package WordPress
* @subpackage Feed
* @since 2.2.0
* @uses apply_filters() Calls 'wp_title_rss' on the blog title.
* @see wp_title() $sep parameter usage.
*
* @param string $sep Optional.
*/
function wp_title_rss($sep = '»')
{
echo apply_filters('wp_title_rss', get_wp_title_rss($sep));
}
示例4: bbp_display_replies_feed_rss2
/**
* Output an RSS2 feed of replies, based on the query passed.
*
* @since bbPress (r3171)
*
* @uses bbp_version()
* @uses bbp_is_single_topic()
* @uses bbp_user_can_view_forum()
* @uses bbp_get_topic_forum_id()
* @uses bbp_show_load_topic()
* @uses bbp_topic_permalink()
* @uses bbp_topic_title()
* @uses bbp_get_topic_reply_count()
* @uses bbp_topic_content()
* @uses bbp_has_replies()
* @uses bbp_replies()
* @uses bbp_the_reply()
* @uses bbp_reply_url()
* @uses bbp_reply_title()
* @uses bbp_reply_content()
* @uses get_wp_title_rss()
* @uses get_option()
* @uses bloginfo_rss
* @uses self_link()
* @uses the_author()
* @uses get_post_time()
* @uses rss_enclosure()
* @uses do_action()
* @uses apply_filters()
*
* @param array $replies_query
*/
function bbp_display_replies_feed_rss2($replies_query = array())
{
// User cannot access forum this topic is in
if (bbp_is_single_topic() && !bbp_user_can_view_forum(array('forum_id' => bbp_get_topic_forum_id()))) {
return;
}
// Adjust the title based on context
if (bbp_is_single_topic() && bbp_user_can_view_forum(array('forum_id' => bbp_get_topic_forum_id()))) {
$title = apply_filters('wp_title_rss', get_wp_title_rss(' » '));
} elseif (!bbp_show_lead_topic()) {
$title = ' » ' . __('All Posts', 'bbpress');
} else {
$title = ' » ' . __('All Replies', 'bbpress');
}
// Display the feed
header('Content-Type: ' . feed_content_type('rss-http') . '; charset=' . get_option('blog_charset'), true);
header('Status: 200 OK');
echo '<?xml version="1.0" encoding="' . get_option('blog_charset') . '"?' . '>';
?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
<?php
do_action('bbp_feed');
?>
>
<channel>
<title><?php
bloginfo_rss('name');
echo $title;
?>
</title>
<atom:link href="<?php
self_link();
?>
" rel="self" type="application/rss+xml" />
<link><?php
self_link();
?>
</link>
<description><?php
//
?>
</description>
<pubDate><?php
echo mysql2date('D, d M Y H:i:s O', current_time('mysql'), false);
?>
</pubDate>
<generator>http://bbpress.org/?v=<?php
bbp_version();
?>
</generator>
<language><?php
bloginfo_rss('language');
?>
</language>
<?php
do_action('bbp_feed_head');
?>
<?php
if (bbp_is_single_topic()) {
//.........这里部分代码省略.........
示例5: tLoadFeed
/**
* Universal Feed Loader
* hooked function
* supports custom settings
* NOTE uses just-in-time initialization
* @see functions.php, feed-links include module
* @uses Universal Feed Writer class
*/
function tLoadFeed()
{
global $tFeeds, $tCurrentFeed, $wp_query, $post;
$tCurrentFeed = get_query_var('feed');
// FB::trace($tCurrentFeed);
if (empty($tCurrentFeed) || $tCurrentFeed == 'feed') {
$tCurrentFeed = get_default_feed();
# rss2
}
$args =& $tFeeds[$tCurrentFeed];
$defaults = array('num_entries' => get_option('posts_per_rss'), 'do_images' => true, 'size_image' => 'large', 'feed_type' => defined('TFEED') ? TFEED : 'atom', 'feed_title' => 'Recent Posts', 'feed_description' => 'An unfiltered list limited to ' . $num_entries . ' posts');
$args = apply_filters('t_load_feed_args', $args);
$args = wp_parse_args($args, $defaults);
# customizing default info
if (is_category()) {
$category = t_get_term_name(get_query_var('cat'), 'category');
$args['feed_title'] = 'Feed for ' . $category;
$args['feed_description'] = 'A list limited to ' . $args['num_entries'] . ' posts categorized under ' . $category;
}
if ($wp_query->is_comment_feed) {
# comment feed
if (is_singular()) {
$args['feed_title'] = 'Recent comments on ' . get_the_title_rss();
} elseif (is_search()) {
$args['feed_title'] = 'Comments for search on ' . attribute_escape($wp_query->query_vars['s']);
} else {
$args['feed_title'] = 'Recent comments for ' . get_wp_title_rss();
}
$args['feed_title'] = ent2ncr($args['feed_title']);
$args['feed_description'] = 'A list limited to ' . $args['num_entries'] . ' comments';
}
$args['query'] = tGetFeedQuery();
if (is_array($args['query'])) {
$args['query']['showposts'] =& $args['num_entries'];
}
if ($tCurrentFeed == 'rss' || $tCurrentFeed == 'rss2' || $tCurrentFeed == 'atom') {
$args['feed_type'] = $tCurrentFeed;
} else {
$args['feed_title'] = ucwords(str_replace('_', ' ', $tCurrentFeed));
}
extract($args);
# namespacing
switch ($feed_type) {
case 'rss2':
$namespace = '
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
';
$feedType = RSS2;
break;
case 'rss':
$namespace = '
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
';
$feedType = RSS1;
break;
case 'atom':
default:
$namespace = '
xmlns:thr="http://purl.org/syndication/thread/1.0"
xml:lang="' . get_option('rss_language') . '"
xml:base="' . get_bloginfo_rss('url') . '"
';
$feedType = ATOM;
break;
}
$GLOBALS['t_feed_ns'] = $namespace;
# for use in FeedWriter
add_filter('t_feed_ns', create_function('$default', 'return $default . $GLOBALS["t_feed_ns"];'));
# start
$feedWriter = new FeedWriter($feedType);
require TDIR . TMODINC . 'feed-head.php';
require TDIR . TMODINC . 'feed-body.php';
# output
$out = ob_get_contents();
$out = str_replace(array("\n", "\r", "\t", ' '), '', $input);
ob_end_clean();
$feedWriter->generateFeed();
// lifestream_rss_feed();
// FB::info($args);
}
示例6: do_action
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
<?php
do_action('rss2_ns');
do_action('rss2_comments_ns');
?>
>
<channel>
<title><?php
if (is_singular()) {
printf(ent2ncr(__('Comments on: %s')), get_the_title_rss() . ' by ' . $user_print_name);
} elseif (is_search()) {
printf(ent2ncr(__('Comments for %s searching on %s')), get_bloginfo_rss('name'), esc_attr($wp_query->query_vars['s']));
} else {
printf(ent2ncr(__('Comments for %s')), get_bloginfo_rss('name') . ' by ' . $user_print_name . get_wp_title_rss());
}
?>
</title>
<atom:link href="<?php
self_link();
?>
" rel="self" type="application/rss+xml" />
<link><?php
is_single() ? the_permalink_rss() : bloginfo_rss("url");
?>
</link>
<description><?php
bloginfo_rss("description");
?>
</description>
示例7: wp_title_rss
/**
* Display the blog title for display of the feed title.
*
* @since 2.2.0
* @see wp_title() $sep parameter usage.
*
* @param string $sep Optional.
*/
function wp_title_rss($sep = '»')
{
/**
* Filter the blog title for display of the feed title.
*
* @since 2.2.0
*
* @see get_wp_title_rss()
*
* @param string $wp_title The current blog title.
* @param string $sep Separator used by wp_title().
*/
echo apply_filters('wp_title_rss', get_wp_title_rss($sep), $sep);
}
示例8: weaverii_sc_info
function weaverii_sc_info()
{
global $current_user;
$out = '<strong>' . WEAVERII_THEMEVERSION . ' Info</strong><hr />';
get_currentuserinfo();
if (isset($current_user->display_name)) {
$out .= '<em>User:</em> ' . $current_user->display_name . '<br />';
}
$out .= ' ' . wp_register('', '<br />', false);
$out .= ' ' . wp_loginout('', false) . '<br />';
global $weaverii_mobile;
$device = $weaverii_mobile;
$out .= '<em>Browser:</em> ' . ($device ? $device['browser'] . '/' . $device['type'] . '/' . $device['os'] : 'Non-Mobile Browser') . '<br />';
$agent = 'Not Available';
if (isset($_SERVER["HTTP_USER_AGENT"])) {
$agent = $_SERVER['HTTP_USER_AGENT'];
}
$out .= '<em>User Agent</em>: <small>' . $agent . '</small>';
$out .= '<div id="example"></div>
<script type="text/javascript">
var txt = "";
var myWidth;
if( typeof( window.innerWidth ) == "number" ) {
//Non-IE
myWidth = window.innerWidth;
} else if( document.documentElement &&
( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in "standards compliant mode"
myWidth = document.documentElement.clientWidth;
} else if ( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
}
txt+= "<em>Browser Width: </em>" + myWidth + " px<br>";
document.getElementById("example").innerHTML=txt;
</script>';
if (!weaverii_use_inline_css(weaverii_get_css_filename())) {
$out .= '<em>Using CSS file:</em> ' . weaverii_get_css_filename();
} else {
$out .= '<em>Using Inline CSS</em>';
}
$out .= '<br /><em>Mobile Mode: </em> ' . weaverii_getopt('_wii_mode_mobile');
$out .= '<br /><em>Feed title:</em> ' . get_bloginfo_rss('name') . get_wp_title_rss();
$out .= '<br /><em>You are using</em> WordPress ' . $GLOBALS['wp_version'] . '<br /><em>PHP Version:</em> ' . phpversion();
$out .= '<br /><em>Memory:</em> ' . round(memory_get_usage() / 1024 / 1024, 2) . 'M of ' . (int) ini_get('memory_limit') . 'M <hr />';
return $out;
}
示例9: ts_feed_spruce_rss2_head
/**
* Inject into RSS2 xml header
* @see http://www.w3schools.com/rss/rss_reference.asp
*/
function ts_feed_spruce_rss2_head()
{
$options = ts_feed_spruce_get_options();
if (!empty($options['rss2image'])) {
echo "<image>";
echo "<link>" . get_bloginfo_rss('url') . '</link>';
echo "<title>" . get_bloginfo_rss('name') . get_wp_title_rss('»') . '</title>';
echo "<url>" . esc_url($options['rss2image']) . '</url>';
echo "</image>";
}
echo '<copyright><![CDATA[';
if (!empty($options['copyright'])) {
echo ent2ncr(strip_tags(str_ireplace('%year%', copyright_date(), $options['copyright'])));
} else {
echo ent2ncr('(c) ' . copyright_date() . ' ' . get_bloginfo('name'));
}
echo ']]></copyright>';
}
示例10: amt_metadata_analysis
function amt_metadata_analysis($default_text, $metadata_block_head, $metadata_block_footer, $metadata_block_content_filter)
{
// Analysis is appended only o content pages
if (!is_singular()) {
return $default_text;
}
// Check the filter based switch
if (!apply_filters('amt_metadata_analysis_enable', true)) {
return $default_text;
}
//
// Collect data
//
$options = amt_get_options();
$post = amt_get_queried_object();
if (!isset($post->ID) || $post->ID <= 0) {
return $default_text;
}
// Content and stats
// Post content
$post_content = strtolower(amt_get_clean_post_content($options, $post));
$post_content_length = strlen($post_content);
//var_dump($post_content);
// Total words
if (function_exists('wordstats_words')) {
$post_word_count = wordstats_words($post_content);
// provided by the word-statistics-plugin by FD
} else {
$post_word_count = str_word_count($post_content);
}
// Total sentences
if (function_exists('wordstats_sentences')) {
$post_sentence_count = wordstats_sentences($post_content);
// provided by the word-statistics-plugin by FD
} else {
$post_sentence_count = preg_match_all('/[.!?\\r]/', $post_content, $dummy);
}
// Total syllables
// TODO: Find better function
$post_syllable_count = preg_match_all('/[aeiouy]/', $post_content, $dummy);
// Titles
// Original
$post_title = strtolower(strip_tags(get_the_title($post->ID)));
// Title HTML element
if ($options['enable_advanced_title_management'] == '1') {
// If Advanced Title management is enabled, use this directly:
$post_title_html_element = strtolower(amt_get_title_for_title_element($options, $post));
} else {
if (version_compare(get_bloginfo('version'), '4.4', '>=')) {
// Since WP 4.4
// - https://make.wordpress.org/core/2015/10/20/document-title-in-4-4/
//$post_title_html_element = strtolower( apply_filters('document_title_parts', array('title' => $post_title) ) );
//$post_title_html_element = wp_get_document_title();
$post_title_html_element = strtolower(get_wp_title_rss());
} else {
// Reverting back to the one argument version of the fitlering function.
//$post_title_html_element = strtolower( apply_filters('wp_title', $post_title) );
// Until testing is performed on old WP versions we just use post title
$post_title_html_element = $post_title;
}
}
//var_dump($post_title_html_element);
// Title in metadata
$post_title_metadata = strtolower(amt_get_title_for_metadata($options, $post));
//var_dump($post_title_metadata);
// URL
$post_url = str_replace(get_bloginfo('url'), '', amt_get_permalink_for_multipage($post));
//var_dump($post_url);
// Description
$description = '';
if (array_key_exists('basic:description', $metadata_block_head)) {
$description = strtolower(preg_replace('#^.*content="([^"]+)".*$#', '$1', $metadata_block_head['basic:description']));
}
//var_dump($description);
// Keywords
$keywords = array();
if (array_key_exists('basic:keywords', $metadata_block_head)) {
$keywords_content = strtolower(preg_replace('#^.*content="([^"]+)".*$#', '$1', $metadata_block_head['basic:keywords']));
$keywords = explode(',', str_replace(', ', ',', $keywords_content));
}
//var_dump($keywords);
// Keyword matching pattern
//$keyword_matching_pattern = '#(?:%s)#';
//$keyword_matching_pattern = '#(?:%s)[[:^alpha:]]#';
//$keyword_matching_pattern = '#(?:%s)[[:^alpha:]]?#';
$keyword_matching_pattern = '#(?:%s)(?:[[:^alpha:]]|$)#';
$keyword_matching_pattern = apply_filters('amt_metadata_analysis_keyword_matching_pattern', $keyword_matching_pattern);
// Whether to use topic keywords field or the keywords from the 'keywords' meta tag.
$use_keywords = false;
// First check for a field that contains topic keywords.
$topic_keywords_field_name = apply_filters('amt_metadata_analysis_topic_keywords_field', 'topic_keywords');
$topic_keywords_field_value = get_post_meta($post->ID, $topic_keywords_field_name, true);
if (!empty($topic_keywords_field_value)) {
$topic_keywords = explode(',', str_replace(', ', ',', $topic_keywords_field_value));
} else {
$topic_keywords = $keywords;
$use_keywords = true;
//var_dump($topic_keywords);
}
$BR = PHP_EOL;
//.........这里部分代码省略.........
示例11: rss2_icon
/**
* Display icons in RSS2.
*/
public function rss2_icon()
{
/** This filter is documented in modules/site-icon/jetpack-site-icon.php */
if (apply_filters('site_icon_has_favicon', false)) {
return;
}
$rss_title = get_wp_title_rss();
if (empty($rss_title)) {
$rss_title = get_bloginfo_rss('name');
}
$icon = jetpack_site_icon_url(null, 32);
if ($icon) {
echo '
<image>
<url>' . convert_chars($icon) . '</url>
<title>' . $rss_title . '</title>
<link>' . get_bloginfo_rss('url') . '</link>
<width>32</width>
<height>32</height>
</image> ' . "\n";
}
}
示例12: enable_seo
function enable_seo()
{
global $post;
global $wp_query;
$post_datas = mars_get_post_data($post->ID);
$meta = NULL;
$layout = get_post_meta($post->ID, 'layout', true) ? get_post_meta($post->ID, 'layout', true) : 'small';
if ($layout == 'large') {
### Fullwidth Video
$width = 1140;
$height = 641;
} else {
### Right sidebar Video
$width = 750;
$height = 442;
}
### meta title
$meta .= '<meta name="title" content="' . get_wp_title_rss() . '">';
### meta description, keywords
if (is_home() || is_front_page() || is_archive() || is_category()) {
$meta .= '<meta name="description" content="' . get_bloginfo('description') . '">';
$meta .= '<meta name="keywords" content="' . get_bloginfo('name') . '">';
} elseif (get_post_type($post->ID) == 'video') {
$meta .= '<meta name="description" content="' . mars_seo_limit_leng_titlewords(wp_filter_nohtml_kses($post_datas->post_content, 30)) . '">';
$meta .= '<meta name="keywords" content="' . $this->wp_get_post_terms_string($post->ID, 'video_tag') . '">';
} else {
$meta .= '<meta name="description" content="' . mars_seo_limit_leng_titlewords(wp_filter_nohtml_kses($post_datas->post_content, 30)) . '">';
$meta .= '<meta name="keywords" content="' . $this->wp_get_post_terms_string($post->ID, 'post_tag') . '">';
}
### og tag.
$meta .= '<meta property="og:site_name" content="' . get_wp_title_rss() . '">';
if (is_home() && !is_front_page()) {
$meta .= '<meta property="og:url" content="' . home_url() . '">';
$meta .= '<meta property="og:title" content="' . get_bloginfo('name') . '">';
$meta .= '<meta property="og:description" content="' . get_bloginfo('description') . '">';
}
if (is_archive()) {
$meta .= '<meta property="og:url" content="' . get_post_type_archive_link(get_post_type()) . '">';
$meta .= '<meta property="og:title" content="' . $wp_query->get_queried_object()->name . '">';
$meta .= '<meta property="og:description" content="' . $wp_query->get_queried_object()->name . '">';
}
if (is_tax() || is_category() || is_tag()) {
$meta .= '<meta property="og:url" content="' . get_term_link($wp_query->get_queried_object()->term_id, $wp_query->get_queried_object()->taxonomy) . '">';
$meta .= '<meta property="og:title" content="' . $wp_query->get_queried_object()->name . '">';
$meta .= '<meta property="og:description" content="' . $wp_query->get_queried_object()->name . '">';
}
if (is_single() || is_singular('video') || is_page()) {
$meta .= '<meta property="og:url" content="' . get_permalink($post->ID) . '">';
$meta .= '<meta property="og:title" content="' . $post_datas->post_title . '">';
if (is_singular('video')) {
$meta .= '<meta property="og:type" content="video">';
}
if (has_post_thumbnail($post->ID)) {
$thumb_id = get_post_thumbnail_id($post->ID);
$thumb_url = wp_get_attachment_image_src($thumb_id, 'full', true);
$meta .= '<meta property="og:image" content="' . $thumb_url[0] . '">';
}
$meta .= '<meta property="og:description" content="' . $post_datas->post_title . '">';
if (get_post_type($post->ID) == 'video') {
$video_file_url = wp_get_attachment_url(get_post_meta($post->ID, 'video_file', true));
if ($video_file_url) {
$meta .= '<meta property="og:video" content="' . $video_file_url . '">';
} else {
$meta .= '<meta property="og:video" content="' . get_permalink($post->ID) . '">';
}
$meta .= '
<meta property="og:video:type" content="application/x-shockwave-flash">
<meta property="og:video:width" content="' . $width . '">
<meta property="og:video:height" content="' . $height . '">
';
}
}
print $meta;
}
示例13: powerpress_rss2_head
//.........这里部分代码省略.........
if (!empty($Feed['itunes_image'])) {
echo "\t" . '<itunes:image href="' . esc_html(str_replace(' ', '+', $Feed['itunes_image']), 'double') . '" />' . PHP_EOL;
} else {
echo "\t" . '<itunes:image href="' . powerpress_get_root_url() . 'itunes_default.jpg" />' . PHP_EOL;
}
if (!empty($Feed['email'])) {
echo "\t" . '<itunes:owner>' . PHP_EOL;
echo "\t\t" . '<itunes:name>' . esc_html($powerpress_feed['itunes_talent_name']) . '</itunes:name>' . PHP_EOL;
echo "\t\t" . '<itunes:email>' . esc_html($Feed['email']) . '</itunes:email>' . PHP_EOL;
echo "\t" . '</itunes:owner>' . PHP_EOL;
echo "\t" . '<managingEditor>' . esc_html($Feed['email'] . ' (' . $powerpress_feed['itunes_talent_name'] . ')') . '</managingEditor>' . PHP_EOL;
}
if (!empty($Feed['copyright'])) {
// In case the user entered the copyright html version or the copyright UTF-8 or ASCII symbol or just (c)
$Feed['copyright'] = str_replace(array('©', '(c)', '(C)', chr(194) . chr(169), chr(169)), '©', $Feed['copyright']);
echo "\t" . '<copyright>' . esc_html($Feed['copyright']) . '</copyright>' . PHP_EOL;
}
if (!empty($Feed['itunes_subtitle'])) {
echo "\t" . '<itunes:subtitle>' . powerpress_format_itunes_value($Feed['itunes_subtitle'], 'subtitle') . '</itunes:subtitle>' . PHP_EOL;
} else {
echo "\t" . '<itunes:subtitle>' . powerpress_format_itunes_value(get_bloginfo('description'), 'subtitle') . '</itunes:subtitle>' . PHP_EOL;
}
if (!empty($Feed['rss2_image']) || !empty($Feed['itunes_image'])) {
if (!empty($Feed['rss2_image'])) {
// If the RSS image is set, use it, otherwise use the iTunes image...
$rss_image = $Feed['rss2_image'];
} else {
$rss_image = $Feed['itunes_image'];
}
echo "\t" . '<image>' . PHP_EOL;
if (is_category() && !empty($Feed['title'])) {
echo "\t\t" . '<title>' . esc_html(get_bloginfo_rss('name')) . '</title>' . PHP_EOL;
} else {
echo "\t\t" . '<title>' . esc_html(get_bloginfo_rss('name') . get_wp_title_rss()) . '</title>' . PHP_EOL;
}
echo "\t\t" . '<url>' . esc_html(str_replace(' ', '+', $rss_image)) . '</url>' . PHP_EOL;
echo "\t\t" . '<link>' . $Feed['url'] . '</link>' . PHP_EOL;
echo "\t" . '</image>' . PHP_EOL;
} else {
echo "\t" . '<image>' . PHP_EOL;
if ((is_category() || is_tax() || is_tag()) && !empty($Feed['title'])) {
echo "\t\t" . '<title>' . esc_html(get_bloginfo_rss('name')) . '</title>' . PHP_EOL;
} else {
echo "\t\t" . '<title>' . esc_html(get_bloginfo_rss('name') . get_wp_title_rss()) . '</title>' . PHP_EOL;
}
echo "\t\t" . '<url>' . powerpress_get_root_url() . 'rss_default.jpg</url>' . PHP_EOL;
echo "\t\t" . '<link>' . $Feed['url'] . '</link>' . PHP_EOL;
echo "\t" . '</image>' . PHP_EOL;
}
// Handle iTunes categories
$Categories = powerpress_itunes_categories();
$Cat1 = false;
$Cat2 = false;
$Cat3 = false;
if (!empty($Feed['itunes_cat_1'])) {
list($Cat1, $SubCat1) = explode('-', $Feed['itunes_cat_1']);
}
if (!empty($Feed['itunes_cat_2'])) {
list($Cat2, $SubCat2) = explode('-', $Feed['itunes_cat_2']);
}
if (!empty($Feed['itunes_cat_3'])) {
list($Cat3, $SubCat3) = explode('-', $Feed['itunes_cat_3']);
}
if ($Cat1) {
$CatDesc = $Categories[$Cat1 . '-00'];
$SubCatDesc = $Categories[$Cat1 . '-' . $SubCat1];
示例14: powerpress_load_general_feed_settings
function powerpress_load_general_feed_settings()
{
global $wp_query;
global $powerpress_feed;
if ($powerpress_feed !== false) {
$powerpress_feed = false;
// Get the powerpress settings
$GeneralSettings = get_option('powerpress_general');
if (!isset($GeneralSettings['custom_feeds']['podcast'])) {
$GeneralSettings['custom_feeds']['podcast'] = 'Podcast Feed';
}
// Fixes scenario where the user never configured the custom default podcast feed.
if ($GeneralSettings) {
$FeedSettingsBasic = get_option('powerpress_feed');
// Get overall feed settings
if (is_feed() && defined('WPCACHEHOME') && empty($GeneralSettings['allow_feed_comments'])) {
global $wp_super_cache_comments;
$wp_super_cache_comments = 0;
}
if (is_feed() && defined('W3TC') && empty($GeneralSettings['allow_feed_comments'])) {
add_filter('w3tc_can_print_comment', 'powerpress_w3tc_can_print_comment', 10, 1);
}
// If we're in advanced mode and we're dealing with a category feed we're extending, lets work with it...
if (is_category() && isset($GeneralSettings['custom_cat_feeds']) && is_array($GeneralSettings['custom_cat_feeds']) && in_array(get_query_var('cat'), $GeneralSettings['custom_cat_feeds'])) {
$cat_ID = get_query_var('cat');
$FeedCustom = get_option('powerpress_cat_feed_' . $cat_ID);
// Get custom feed specific settings
$Feed = powerpress_merge_empty_feed_settings($FeedCustom, $FeedSettingsBasic);
$powerpress_feed = array();
$powerpress_feed['is_custom'] = true;
$powerpress_feed['category'] = $cat_ID;
$powerpress_feed['process_podpress'] = !empty($GeneralSettings['process_podpress']);
// Category feeds could originate from Podpress
$powerpress_feed['rss_language'] = '';
// default, let WordPress set the language
$powerpress_feed['default_url'] = '';
if (!empty($GeneralSettings['default_url'])) {
$powerpress_feed['default_url'] = rtrim($GeneralSettings['default_url'], '/') . '/';
}
$explicit_array = array("no", "yes", "clean");
$powerpress_feed['explicit'] = $explicit_array[$Feed['itunes_explicit']];
if (!empty($Feed['itunes_talent_name'])) {
$powerpress_feed['itunes_talent_name'] = $Feed['itunes_talent_name'];
} else {
$powerpress_feed['itunes_talent_name'] = get_wp_title_rss();
}
$powerpress_feed['enhance_itunes_summary'] = $Feed['enhance_itunes_summary'];
if (!empty($GeneralSettings['seo_itunes'])) {
$powerpress_feed['enhance_itunes_summary'] = 1;
}
$powerpress_feed['posts_per_rss'] = false;
if (!empty($Feed['posts_per_rss']) && is_numeric($Feed['posts_per_rss']) && $Feed['posts_per_rss'] > 0) {
$powerpress_feed['posts_per_rss'] = $Feed['posts_per_rss'];
}
$powerpress_feed['feed_redirect_url'] = '';
if (!empty($Feed['feed_redirect_url'])) {
$powerpress_feed['feed_redirect_url'] = $Feed['feed_redirect_url'];
}
if ($Feed['itunes_author_post'] == true) {
$powerpress_feed['itunes_author_post'] = true;
}
if ($Feed['rss_language'] != '') {
$powerpress_feed['rss_language'] = $Feed['rss_language'];
}
if (!empty($GeneralSettings['podcast_embed_in_feed'])) {
$powerpress_feed['podcast_embed_in_feed'] = true;
}
if (!empty($Feed['episode_itunes_image']) && !empty($Feed['itunes_image'])) {
$powerpress_feed['itunes_image'] = $Feed['itunes_image'];
}
return;
} else {
if ((defined('POWERPRESS_TAXONOMY_PODCASTING') || !empty($GeneralSettings['taxonomy_podcasting'])) && (is_tag() || is_tax())) {
// We need to get the term_id and the tax_id (tt_id)
$term_slug = get_query_var('term');
$taxonomy = get_query_var('taxonomy');
if (empty($term_slug) && empty($taxonomy)) {
$term_slug = get_query_var('tag');
if (!empty($term_slug)) {
$taxonomy = 'post_tag';
}
}
$term = false;
if (!empty($term_slug) && !empty($taxonomy)) {
$term = term_exists($term_slug, $taxonomy);
}
if (!empty($term['term_taxonomy_id'])) {
$FeedCustom = get_option('powerpress_taxonomy_' . $term['term_taxonomy_id']);
// Get custom feed specific settings
if ($FeedCustom) {
$Feed = powerpress_merge_empty_feed_settings($FeedCustom, $FeedSettingsBasic);
$powerpress_feed = array();
$powerpress_feed['is_custom'] = true;
$powerpress_feed['term_taxonomy_id'] = $term['term_taxonomy_id'];
$powerpress_feed['process_podpress'] = false;
// Taxonomy feeds will not originate from Podpress
$powerpress_feed['rss_language'] = '';
// default, let WordPress set the language
$powerpress_feed['default_url'] = rtrim($GeneralSettings['default_url'], '/') . '/';
$explicit_array = array("no", "yes", "clean");
//.........这里部分代码省略.........
示例15: rss2_site_icon
/**
* Displays Site Icon in RSS2.
*
* @since 4.3.0
*/
function rss2_site_icon()
{
$rss_title = get_wp_title_rss();
if (empty($rss_title)) {
$rss_title = get_bloginfo_rss('name');
}
$url = get_site_icon_url(32);
if ($url) {
echo '
<image>
<url>' . convert_chars($url) . '</url>
<title>' . $rss_title . '</title>
<link>' . get_bloginfo_rss('url') . '</link>
<width>32</width>
<height>32</height>
</image> ' . "\n";
}
}