• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_feed_link函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_feed_link函数的典型用法代码示例。如果您正苦于以下问题:PHP get_feed_link函数的具体用法?PHP get_feed_link怎么用?PHP get_feed_link使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_feed_link函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: test_pre_posts_per_page

 /**
  * @ticket 25380
  */
 function test_pre_posts_per_page()
 {
     self::factory()->post->create_many(10);
     add_action('pre_get_posts', array($this, 'filter_posts_per_page'));
     $this->go_to(get_feed_link());
     $this->assertEquals(30, get_query_var('posts_per_page'));
 }
开发者ID:ryelle,项目名称:WordPress,代码行数:10,代码来源:query.php


示例2: cap_podcast_change_archive_title

function cap_podcast_change_archive_title($title)
{
    if (is_post_type_archive('cap_podcast')) {
        $title = $title . '<div class="rss-feed"><a href="' . get_feed_link() . '?post_type=cap_podcast"><span class="dashicons dashicons-rss"></span> Subscribe to Podcast</a></div>';
    }
    return $title;
}
开发者ID:amprog,项目名称:cap-podcaster,代码行数:7,代码来源:filters.php


示例3: add_feed_links

 public static function add_feed_links()
 {
     global $wpz_default_feed;
     $wpz_default_feed = get_feed_link();
     add_theme_support('automatic-feed-links');
     add_filter('feed_link', array(__CLASS__, 'custom_feed_links'), 1);
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:7,代码来源:theme.php


示例4: ar2_theme_options_default_fields

/**
 * Retrieves default setting fields for theme options.
 * @since 1.6
 */
function ar2_theme_options_default_fields()
{
    global $ar2_image_sizes, $ar2_styles;
    $_defaults = array('theme_version' => array('type' => 'static', 'title' => __('Version', 'ar2'), 'section' => 'ar2_general_site_info', 'content' => '<strong>' . wp_get_theme()->get('Version') . '</strong>', 'description' => __('If you have recently upgraded Project AR2 to a new release, it is <span style="color: red">highly recommended</span> that you reset your theme options, clear your browser cache and restart your browser before proceeding.', 'ar2')), 'site_rss_feed' => array('type' => 'static', 'title' => __('RSS Feed', 'ar2'), 'section' => 'ar2_general_social', 'content' => '<code>' . get_feed_link('rss2') . '</code>', 'description' => __('Custom feed URLs are no longer allowed due to support for automatic feed links.', 'ar2')), 'social_twitter' => array('type' => 'input', 'title' => __('Twitter Username', 'ar2'), 'section' => 'ar2_general_social'), 'social_facebook' => array('type' => 'input', 'title' => __('Facebook Username', 'ar2'), 'section' => 'ar2_general_social'), 'social_flickr' => array('type' => 'input', 'title' => __('Flickr ID', 'ar2'), 'section' => 'ar2_general_social'), 'social_gplus' => array('type' => 'input', 'title' => __('Google+ ID', 'ar2'), 'section' => 'ar2_general_social'), 'social_youtube' => array('type' => 'input', 'title' => __('YouTube Channel ID', 'ar2'), 'section' => 'ar2_general_social'), 'footer_message' => array('type' => 'textarea_html', 'title' => __('Footer Message', 'ar2'), 'section' => 'ar2_general_footer', 'description' => __("Usually your website's copyright information would go here.<br /> It would be great if you could include a link to WordPress or the theme website. :)", 'ar2'), 'extras' => 'class="code"'), 'nodebased_show_excerpts' => array('type' => 'switch', 'title' => __('Show Excerpts', 'ar2'), 'section' => 'ar2_layout_excerpts'), 'excerpt_limit' => array('type' => 'input', 'title' => __('Excerpt Limit', 'ar2'), 'section' => 'ar2_layout_excerpts', 'extras' => 'style="width: 50px" maxlength="2"', 'description' => __('Excerpts will only be trimmed to the limit if no excerpt is specified for the respective post.', 'ar2')), 'archive_display' => array('type' => 'dropdown', 'title' => __('Display Type', 'ar2'), 'section' => 'ar2_layout_archive', 'options' => ar2_get_archive_display_types()), 'single_posts_display' => array('type' => 'custom', 'title' => __('Display in Single Posts', 'ar2'), 'section' => 'ar2_layout_single', 'callback' => 'ar2_render_single_form_field', 'setting' => 'ar2_theme_options[post_display]'), 'relative_dates' => array('type' => 'checkbox', 'title' => __('Display Relative Post Dates', 'ar2'), 'section' => 'ar2_layout_single', 'description' => __('Check this to display post dates relative to current time (eg. 2 days ago ).', 'ar2')), 'auto_thumbs' => array('type' => 'checkbox', 'title' => __('Auto Thumbnails', 'ar2'), 'section' => 'ar2_thumbnails_options', 'description' => __('Check this to allow the theme to automatically retrieve the first attached image from the post as featured image when no image is specified.', 'ar2')), 'layout' => array('type' => 'dropdown', 'title' => __('No of Columns', 'ar2'), 'section' => 'ar2_design_overall', 'options' => $ar2_styles->get_layouts()), 'import_theme_options' => array('type' => 'textarea', 'title' => __('Import Theme Options', 'ar2'), 'section' => 'ar2_tools_port', 'description' => __('Import your theme settings by pasting the exported code in the textbox above.', 'ar2'), 'extras' => 'class="code"'), 'export_theme_options' => array('type' => 'textarea', 'title' => __('Export Theme Options', 'ar2'), 'section' => 'ar2_tools_port', 'description' => __('You can save the code above into a text file and use it when you need to import them into another installation. Note that not all options (custom background, child theme settings, etc.) will be exported.', 'ar2'), 'extras' => 'class="code"', 'value' => json_encode(ar2_flush_theme_options())));
    foreach ($ar2_image_sizes as $id => $args) {
        $_defaults[$id] = array('type' => 'thumbnail-size', 'title' => $args['name'], 'setting' => 'ar2_theme_options[thumbnails][' . $id . ']', 'section' => 'ar2_thumbnails_sizes', 'width' => $args['w'], 'height' => $args['h'], 'd_width' => $args['dw'], 'd_height' => $args['dh']);
    }
    if (AR2_ALLOW_CUSTOM_STYLES) {
        $_defaults['style'] = array('type' => 'dropdown', 'title' => __('Custom Stylesheet', 'ar2'), 'section' => 'ar2_design_overall', 'options' => ar2_get_custom_css_files(), 'description' => sprintf(__('Stylesheets can be placed in %s.', 'ar2'), '<code>wp-content/themes/' . get_stylesheet() . '/css/styles/</code>'));
    }
    // Allow developers to add more fields
    $_defaults = apply_filters('ar2_theme_options_fields', $_defaults);
    // Process the fields
    $sections = ar2_theme_options_default_sections();
    $_default_args = array('title' => '', 'type' => 'static', 'section' => 'ar2_general_site_info', 'page' => 'ar2_general', 'content' => '', 'extras' => '');
    foreach ($_defaults as $id => &$args) {
        if (!isset($args['setting'])) {
            $args['setting'] = 'ar2_theme_options[' . $id . ']';
        }
        // Parse the ID for array keys (adapted from WP_Customize_Setting class).
        $args['_id_data']['keys'] = preg_split('/\\[/', str_replace(']', '', $args['setting']));
        $args['_id_data']['base'] = array_shift($args['_id_data']['keys']);
        if (isset($sections[$args['section']])) {
            $args['page'] = $sections[$args['section']]['page'];
        }
        $args = wp_parse_args($args, $_default_args);
    }
    return $_defaults;
}
开发者ID:SublimeCoralie,项目名称:project-ar2,代码行数:33,代码来源:admin.php


示例5: loadOptions

 public function loadOptions()
 {
     global $wpdb, $shortname;
     $themeOptions = array();
     if (!empty($this->options)) {
         foreach ($this->options as $option) {
             if (isset($option["id"]) && $option["id"] != '' && $option["id"] != $shortname . '_code') {
                 $themeOptions[$option["id"]] = "";
             }
         }
         $themeKeys = '"';
         $themeKeys .= join('","', array_keys($themeOptions));
         $themeKeys .= '"';
         $optionValues = $wpdb->get_results('SELECT option_name, option_value FROM wp_options WHERE option_name IN (' . $themeKeys . ')');
         foreach ($optionValues as $optionValue) {
             $themeOptions[$optionValue->option_name] = $optionValue->option_value;
         }
         wp_reset_query();
         $wpdb->flush();
     }
     $themeOptions['feed'] = get_feed_link();
     $themeOptions['site_name'] = get_bloginfo('name');
     $themeOptions['site_link'] = esc_url(home_url('/'));
     return $themeOptions;
 }
开发者ID:jonnSmith,项目名称:jadeWP,代码行数:25,代码来源:wpThemeoptions.php


示例6: head_cleanup

/**
 * Clean up wp_head()
 *
 * Remove unnecessary <link>'s
 * Remove inline CSS and JS from WP emoji support
 * Remove inline CSS used by Recent Comments widget
 * Remove inline CSS used by posts with galleries
 * Remove self-closing tag and change ''s to "'s on rel_canonical()
 *
 * You can enable/disable this feature in functions.php (or lib/setup.php if you're using Sage):
 * add_theme_support('soil-clean-up');
 */
function head_cleanup()
{
    // Originally from http://wpengineer.com/1438/wordpress-header/
    remove_action('wp_head', 'feed_links_extra', 3);
    add_action('wp_head', 'ob_start', 1, 0);
    add_action('wp_head', function () {
        $pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\\r\\n]+/';
        echo preg_replace($pattern, '', ob_get_clean());
    }, 3, 0);
    remove_action('wp_head', 'rsd_link');
    remove_action('wp_head', 'wlwmanifest_link');
    remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0);
    remove_action('wp_head', 'wp_generator');
    remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0);
    remove_action('wp_head', 'print_emoji_detection_script', 7);
    remove_action('admin_print_scripts', 'print_emoji_detection_script');
    remove_action('wp_print_styles', 'print_emoji_styles');
    remove_action('admin_print_styles', 'print_emoji_styles');
    remove_action('wp_head', 'wp_oembed_add_discovery_links');
    remove_action('wp_head', 'wp_oembed_add_host_js');
    remove_action('wp_head', 'rest_output_link_wp_head', 10, 0);
    remove_filter('the_content_feed', 'wp_staticize_emoji');
    remove_filter('comment_text_rss', 'wp_staticize_emoji');
    remove_filter('wp_mail', 'wp_staticize_emoji_for_email');
    add_filter('use_default_gallery_style', '__return_false');
    global $wp_widget_factory;
    if (isset($wp_widget_factory->widgets['WP_Widget_Recent_Comments'])) {
        remove_action('wp_head', [$wp_widget_factory->widgets['WP_Widget_Recent_Comments'], 'recent_comments_style']);
    }
    if (!class_exists('WPSEO_Frontend')) {
        remove_action('wp_head', 'rel_canonical');
        add_action('wp_head', __NAMESPACE__ . '\\rel_canonical');
    }
}
开发者ID:wearegiants,项目名称:EightyTwo,代码行数:46,代码来源:clean-up.php


示例7: feed_link_variations

 /**
  * Feed link variations.
  *
  * @since 150218 Refactoring cache clear/purge routines.
  *
  * @param string $type_prefix A feed type prefix; optional.
  *
  * @return array An array of all feed link variations.
  */
 public function feed_link_variations($type_prefix = '')
 {
     $variations = array();
     // Initialize.
     foreach ($this->feed_types as $_feed_type) {
         $variations[] = get_feed_link((string) $type_prefix . $_feed_type);
     }
     unset($_feed_type);
     // Housekeeping.
     return $variations;
 }
开发者ID:GarryVeles,项目名称:Artibaltika,代码行数:20,代码来源:utils-feed.php


示例8: ping_feevy

function ping_feevy()
{
    $url = "http://localhost:3000/ping/update";
    $data = "url=" . urlencode(get_feed_link('rss2'));
    $params = array('http' => array('method' => 'POST', 'content' => $data));
    $ctx = stream_context_create($params);
    $fp = @fopen($url, 'rb', false, $ctx);
    if (!$fp) {
        throw new Exception("Problem with {$url}, {$php_errormsg}");
    }
}
开发者ID:jesus-favs,项目名称:favs,代码行数:11,代码来源:feevy_ping.php


示例9: wpHead

    public function wpHead()
    {
        ?>
        <link rel="alternate" type="application/atom+xml" title="<?php 
        echo esc_attr(get_bloginfo('name'));
        ?>
 Feed" href="<?php 
        echo esc_attr(get_feed_link('atom'));
        ?>
">
        <?php 
    }
开发者ID:dxw,项目名称:iguana-extras,代码行数:12,代码来源:UseAtom.php


示例10: govsite_core_behaviour_wp_head

function govsite_core_behaviour_wp_head()
{
    ?>
    <link rel="alternate" type="application/atom+xml" title="<?php 
    echo get_bloginfo('name');
    ?>
 Feed" href="<?php 
    echo esc_attr(get_feed_link('atom'));
    ?>
">
    <?php 
}
开发者ID:stevanbarry,项目名称:govsite,代码行数:12,代码来源:core_behaviour.php


示例11: language_attributes

<!doctype html>
<html class="no-js" <?php language_attributes(); ?>>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">

  <link rel="alternate" type="application/rss+xml" title="<?php echo get_bloginfo('name'); ?> Feed" href="<?php echo esc_url(get_feed_link()); ?>">

  <?php wp_head(); ?>
  <!--[if lt IE 9]>
    <script type="text/javascript" src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script type="text/javascript" src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
  <![endif]-->
  <!--[if lt IE 9]>
    <link rel="stylesheet" href="<?php bloginfo('template_url')?>/assets/css/ie8-style.css" type="text/css" />
  <![endif]-->
  <script src='https://www.google.com/recaptcha/api.js'></script>
</head>
开发者ID:alvarpoon,项目名称:aeg,代码行数:19,代码来源:head.php


示例12: test_main_feed

 function test_main_feed()
 {
     self::factory()->post->create();
     // @test_404
     $types = array('rss2', 'rss', 'atom');
     foreach ($types as $type) {
         $this->go_to(get_feed_link($type));
         $this->assertQueryTrue('is_feed');
     }
 }
开发者ID:pbearne,项目名称:contrib2core,代码行数:10,代码来源:conditionals.php


示例13: jw_baiping

function jw_baiping($post_id)
{
    $baiduXML = 'weblogUpdates.extendedPing' . get_option('blogname') . ' ' . home_url() . ' ' . get_permalink($post_id) . ' ' . get_feed_link() . ' ';
    $wp_http_obj = new WP_Http();
    $return = $wp_http_obj->post('http://ping.baidu.com/ping/RPC2', array('body' => $baiduXML, 'headers' => array('Content-Type' => 'text/xml')));
    if (isset($return['body'])) {
        if (strstr($return['body'], '0')) {
            $noff_log = 'succeeded!';
        } else {
            $noff_log = 'failed!';
        }
    } else {
        $noff_log = 'failed!';
    }
}
开发者ID:qtxh,项目名称:wordpress-optimize,代码行数:15,代码来源:wordpress-optimize.php


示例14: feed_links

/**
 * Display the links to the general feeds.
 *
 * @since 2.8.0
 *
 * @param array $args Optional arguments.
 */
function feed_links($args = array())
{
    if (!current_theme_supports('automatic-feed-links')) {
        return;
    }
    $defaults = array('separator' => _x('&raquo;', 'feed link'), 'feedtitle' => __('%1$s %2$s Feed'), 'comstitle' => __('%1$s %2$s Comments Feed'));
    $args = wp_parse_args($args, $defaults);
    /**
     * Filter whether to display the posts feed link.
     *
     * @since 4.4.0
     *
     * @param bool $show Whether to display the posts feed link. Default true.
     */
    if (apply_filters('feed_links_show_posts_feed', true)) {
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf($args['feedtitle'], get_bloginfo('name'), $args['separator'])) . '" href="' . esc_url(get_feed_link()) . "\" />\n";
    }
    /**
     * Filter whether to display the comments feed link.
     *
     * @since 4.4.0
     *
     * @param bool $show Whether to display the comments feed link. Default true.
     */
    if (apply_filters('feed_links_show_comments_feed', true)) {
        echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf($args['comstitle'], get_bloginfo('name'), $args['separator'])) . '" href="' . esc_url(get_feed_link('comments_' . get_default_feed())) . "\" />\n";
    }
}
开发者ID:blogfor,项目名称:king,代码行数:35,代码来源:general-template.php


示例15: ajax_read_url

 static function ajax_read_url()
 {
     return add_query_arg('p2ajax', 'true', get_feed_link('p2.ajax'));
 }
开发者ID:cabelotaina,项目名称:redelivre,代码行数:4,代码来源:js.php


示例16: powerpressadmin_edit_itunes_general

function powerpressadmin_edit_itunes_general($FeedSettings, $General, $FeedAttribs = array())
{
    // Set default settings (if not set)
    if (!empty($FeedSettings)) {
        if (!isset($FeedSettings['itunes_url'])) {
            $FeedSettings['itunes_url'] = '';
        }
    }
    if (!isset($General['itunes_url'])) {
        $General['itunes_url'] = '';
    } else {
        if (!isset($FeedSettings['itunes_url'])) {
            // Should almost never happen
            $FeedSettings['itunes_url'] = $General['itunes_url'];
        }
    }
    $feed_slug = $FeedAttribs['feed_slug'];
    $cat_ID = $FeedAttribs['category_id'];
    if ($feed_slug == 'podcast' && $FeedAttribs['type'] == 'general') {
        if (empty($FeedSettings['itunes_url']) && !empty($General['itunes_url'])) {
            $FeedSettings['itunes_url'] = $General['itunes_url'];
        }
    }
    ?>
<h3><?php 
    echo __('iTunes Listing Information', 'powerpress');
    ?>
</h3>
<table class="form-table">
<tr valign="top">
<th scope="row"><?php 
    echo __('iTunes Subscription URL', 'powerpress');
    ?>
</th> 
<td>
<input type="text" style="width: 80%;" name="Feed[itunes_url]" value="<?php 
    echo esc_attr($FeedSettings['itunes_url']);
    ?>
" maxlength="250" />
<p><?php 
    echo sprintf(__('e.g. %s', 'powerpress'), 'http://itunes.apple.com/podcast/title-of-podcast/id<strong>000000000</strong>');
    ?>
</p>

<p><?php 
    echo sprintf(__('Click the following link to %s.', 'powerpress'), '<a href="https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/publishPodcast" target="_blank">' . __('Publish a Podcast on iTunes', 'powerpress') . '</a>');
    ?>
 <?php 
    echo __('iTunes will email your Subscription URL to the <em>iTunes Email</em> entered below when your podcast is accepted into the iTunes Directory.', 'powerpress');
    ?>
</p>
<p>
<?php 
    echo __('Recommended feed to submit to iTunes: ', 'powerpress');
    switch ($FeedAttribs['type']) {
        case 'ttid':
        case 'category':
            echo get_category_feed_link($cat_ID);
            break;
        case 'channel':
            echo get_feed_link($feed_slug);
            break;
        case 'post_type':
            $url = get_post_type_archive_feed_link($FeedAttribs['post_type'], $feed_slug);
            echo $url;
            break;
        case 'general':
        default:
            echo get_feed_link('podcast');
    }
    ?>
</p>
</td>
</tr>
</table>
<?php 
}
开发者ID:briancfeeney,项目名称:portigal,代码行数:77,代码来源:powerpressadmin-basic.php


示例17: get_bloginfo

function get_bloginfo($show='') {

	switch($show) {
	case 'url' :
	case 'home' : 
	case 'siteurl' :
		$output = get_settings('home');
		break;
	case 'wpurl' :
		$output = get_settings('siteurl');
		break;
	case 'description':
		$output = get_settings('blogdescription');
		break;
	case 'rdf_url':
		$output = get_feed_link('rdf');
		break;
	case 'rss_url':
		$output = get_feed_link('rss');
		break;
	case 'rss2_url':
		$output = get_feed_link('rss2');
		break;
	case 'atom_url':
		$output = get_feed_link('atom');
		break;        
	case 'comments_rss2_url':
		$output = get_feed_link('comments_rss2');
		break;
	case 'pingback_url':
		$output = get_settings('siteurl') .'/xmlrpc.php';
		break;
	case 'stylesheet_url':
		$output = get_stylesheet_uri();
		break;
	case 'stylesheet_directory':
		$output = get_stylesheet_directory_uri();
		break;
	case 'template_directory':
	case 'template_url':
		$output = get_template_directory_uri();
		break;
	case 'admin_email':
		$output = get_settings('admin_email');
		break;
	case 'charset':
		$output = get_settings('blog_charset');
		if ('' == $output) $output = 'UTF-8';
		break;
	case 'html_type' :
		$output = get_option('html_type');
		break;
	case 'version':
		global $wp_version;
		$output = $wp_version;
		break;
	case 'name':
	default:
		$output = get_settings('blogname');
		break;
	}
	return $output;
}
开发者ID:staylor,项目名称:develop.svn.wordpress.org,代码行数:63,代码来源:template-functions-general.php


示例18: podPress_xspf_playlist

function podPress_xspf_playlist()
{
    global $podPress, $more, $posts, $post, $m;
    header('HTTP/1.0 200 OK');
    header('Content-type: application/xspf+xml; charset=' . get_bloginfo('charset'), true);
    header('Content-Disposition: attachment; filename="playlist.xspf"');
    header('Cache-Control: no-cache, must-revalidate');
    // HTTP/1.1
    header('Expires: Wed, 28 Oct 2010 05:00:00 GMT');
    // Date in the past
    $more = 1;
    echo '<?xml version="1.0" encoding="' . get_bloginfo('charset') . '" ?' . ">\n";
    echo '<playlist version="1" xmlns="http://xspf.org/ns/0/">' . "\n";
    echo "\t" . '<title>' . podPress_feedSafeContent(get_bloginfo('blogname')) . '</title>' . "\n";
    echo "\t" . '<annotation><![CDATA[' . $podPress->settings['iTunes']['summary'] . ']]></annotation>' . "\n";
    if (empty($podPress->settings['iTunes']['author'])) {
        $creator = get_bloginfo('blogname');
    } else {
        $creator = $podPress->settings['iTunes']['author'];
    }
    echo "\t" . '<creator>' . podPress_feedSafeContent($creator) . '</creator>' . "\n";
    echo "\t" . '<location>' . get_feed_link('playlist.xspf') . '</location>' . "\n";
    if (!empty($podPress->settings['rss_license_url'])) {
        echo "\t" . '<license>' . $podPress->settings['rss_license_url'] . '</license>' . "\n";
    }
    echo "\t" . '<trackList>' . "\n";
    if (isset($posts)) {
        foreach ($posts as $post) {
            start_wp();
            /* This is a call to a very very old function and it seems to be not necessary if $post is global. */
            $enclosureTag = podPress_getEnclosureTags('xspf');
            if ($enclosureTag != '') {
                // if no enclosure tag, no need for track tags
                $is_password_protected = podpress_post_is_password_protected();
                if (FALSE === $is_password_protected) {
                    echo $enclosureTag;
                }
            }
        }
    }
    echo "\t" . '</trackList>' . "\n";
    echo '</playlist>' . "\n";
    exit;
}
开发者ID:niko-lgdcom,项目名称:archives,代码行数:44,代码来源:podpress_feed_functions.php


示例19: feed_links

/**
 * Display the links to the general feeds.
 *
 * @since 2.8.0
 *
 * @param array $args Optional arguments.
 */
function feed_links($args = array())
{
    if (!current_theme_supports('automatic-feed-links')) {
        return;
    }
    $defaults = array('separator' => _x('&raquo;', 'feed link'), 'feedtitle' => __('%1$s %2$s Feed'), 'comstitle' => __('%1$s %2$s Comments Feed'));
    $args = wp_parse_args($args, $defaults);
    echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf($args['feedtitle'], get_bloginfo('name'), $args['separator'])) . '" href="' . esc_url(get_feed_link()) . "\" />\n";
    echo '<link rel="alternate" type="' . feed_content_type() . '" title="' . esc_attr(sprintf($args['comstitle'], get_bloginfo('name'), $args['separator'])) . '" href="' . esc_url(get_feed_link('comments_' . get_default_feed())) . "\" />\n";
}
开发者ID:jenoya,项目名称:final,代码行数:17,代码来源:general-template.php


示例20: widget

 /** @see WP_Widget::widget */
 function widget($args, $instance)
 {
     global $podPress, $wp_version;
     extract($args);
     $title = apply_filters('widget_title', $instance['title']);
     $feed_icon = '<img src="' . get_option('siteurl') . '/' . WPINC . '/images/rss.png" class="podpress_feed_icon" alt="" />';
     echo $before_widget;
     echo $before_title . $title . $after_title;
     echo '<ul class="podpress_feed_buttons_list">' . "\n";
     switch ($instance['buttons-or-text']) {
         default:
         case 'buttons':
             if ($instance['itunes']) {
                 // for more info: http://www.apple.com/itunes/podcasts/specs.html#linking
                 if ($instance['iprot']) {
                     echo ' <li><a href="itpc://' . preg_replace('/^https?:\\/\\//i', '', $podPress->settings['podcastFeedURL']) . '"';
                 } else {
                     echo ' <li><a href="http://www.itunes.com/podcast?id=' . $podPress->settings['iTunes']['FeedID'] . '"';
                 }
                 if (FALSE == empty($instance['itunes_buttonurl'])) {
                     echo ' title="' . __('Subscribe to the Podcast Feed with iTunes', 'podpress') . '"><img src="' . $instance['itunes_buttonurl'] . '" class="podpress_feed_buttons" alt="' . __('Subscribe with iTunes', 'podpress') . '" /></a></li>' . "\n";
                 } else {
                     echo ' title="' . __('Subscribe to the Podcast Feed with iTunes', 'podpress') . '"><img src="' . podPress_url() . 'images/itunes.png" class="podpress_feed_buttons" alt="' . __('Subscribe with iTunes', 'podpress') . '" /></a></li>' . "\n";
                 }
             }
             // podPress feeds:
             if (is_array($instance['podpressfeeds']) and FALSE == empty($instance['podpressfeeds'])) {
                 foreach ($instance['podpressfeeds'] as $feed_slug => $feed_options) {
                     if ('yes' === $feed_options['use'] and is_array($podPress->settings['podpress_feeds'])) {
                         foreach ($podPress->settings['podpress_feeds'] as $feed) {
                             if ($feed_slug === $feed['slug'] and TRUE === $feed['use']) {
                                 if (FALSE == empty($feed_options['altfeedurl'])) {
                                     $feed_link = $feed_options['altfeedurl'];
                                 } else {
                                     $feed_link = get_feed_link($feed_slug);
                                 }
                                 if (FALSE == empty($feed['slug'])) {
                                     $descr = stripslashes($feed['descr']);
                                 } else {
                                     $descr = __('Subscribe to this Feed with any feed reader', 'podpress');
                                 }
                                 if (FALSE == empty($feed_options['buttonurl'])) {
                                     echo '	<li><a href="' . $feed_link . '" title="' . esc_attr($descr) . '"><img src="' . $feed_options['buttonurl'] . '" class="podpress_feed_buttons" alt="' . esc_attr(stripslashes($feed['name'])) . '" /></a></li>' . "\n";
                                 } else {
                                     echo '	<li><a href="' . $feed_link . '" title="' . esc_attr($descr) . '">' . $feed_icon . ' ' . stripslashes($feed['name']) . '</a></li>' . "\n";
                                 }
                             }
                         }
                     }
                 }
             }
             if ($instance['posts']) {
                 if (FALSE == empty($instance['posts_altfeedurl'])) {
                     $feedlink = $instance['posts_altfeedurl'];
                 } else {
                     $feedlink = get_bloginfo('rss2_url');
                 }
                 if (FALSE == empty($instance['posts_buttonurl'])) {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the main RSS Feed with any feed reader', 'podpress') . '"><img src="' . $instance['posts_buttonurl'] . '" class="podpress_feed_buttons" alt="' . __('Subscribe to the RSS Feed', 'podpress') . '" /></a></li>' . "\n";
                 } else {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the main RSS Feed with any feed reader', 'podpress') . '"><img src="' . podPress_url() . 'images/feed_button-rss-blog.png" class="podpress_feed_buttons" alt="' . __('Subscribe to the RSS Feed', 'podpress') . '" /></a></li>' . "\n";
                 }
             }
             if ($instance['comments']) {
                 if (FALSE == empty($instance['comments_altfeedurl'])) {
                     $feedlink = $instance['comments_altfeedurl'];
                 } else {
                     $feedlink = get_bloginfo('comments_rss2_url');
                 }
                 if (FALSE == empty($instance['comments_buttonurl'])) {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the comments RSS Feed with any feed reader', 'podpress') . '"><img src="' . $instance['comments_buttonurl'] . '" class="podpress_feed_buttons" alt="' . __('Subscribe to the comments RSS Feed', 'podpress') . '" /></a></li>' . "\n";
                 } else {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the comments RSS Feed with any feed reader', 'podpress') . '"><img src="' . podPress_url() . 'images/feed_button-rss-comments.png" class="podpress_feed_buttons" alt="' . __('Subscribe to the comments RSS Feed', 'podpress') . '" /></a></li>' . "\n";
                 }
             }
             if ($instance['entries-atom']) {
                 if (FALSE == empty($instance['entries-atom_altfeedurl'])) {
                     $feedlink = $instance['entries-atom_altfeedurl'];
                 } else {
                     $feedlink = get_bloginfo('atom_url');
                 }
                 if (FALSE == empty($instance['entries-atom_buttonurl'])) {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the main ATOM Feed with any feed reader', 'podpress') . '"><img src="' . $instance['entries-atom_buttonurl'] . '" class="podpress_feed_buttons" alt="' . __('Subscribe to the ATOM Feed', 'podpress') . '" /></a></li>' . "\n";
                 } else {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the main ATOM Feed with any feed reader', 'podpress') . '"><img src="' . podPress_url() . 'images/feed_button-atom-blog.png" class="podpress_feed_buttons" alt="' . __('Subscribe to the ATOM Feed', 'podpress') . '" /></a></li>' . "\n";
                 }
             }
             if ($instance['comments-atom']) {
                 if (FALSE === empty($instance['comments-atom_altfeedurl'])) {
                     $feedlink = $instance['comments-atom_altfeedurl'];
                 } else {
                     $feedlink = get_bloginfo('comments_atom_url');
                 }
                 if (FALSE == empty($instance['comments-atom_buttonurl'])) {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the comments ATOM Feed with any feed reader', 'podpress') . '"><img src="' . $instance['comments-atom_buttonurl'] . '" class="podpress_feed_buttons" alt="' . __('Subscribe to the comments ATOM Feed', 'podpress') . '" /></a></li>' . "\n";
                 } else {
                     echo '	<li><a href="' . $feedlink . '" title="' . __('Subscribe to the comments ATOM Feed with any feed reader', 'podpress') . '"><img src="' . podPress_url() . 'images/feed_button-atom-comments.png" class="podpress_feed_buttons" alt="' . __('Subscribe to the comments ATOM Feed', 'podpress') . '" /></a></li>' . "\n";
                 }
             }
//.........这里部分代码省略.........
开发者ID:niko-lgdcom,项目名称:archives,代码行数:101,代码来源:podpress_functions.php



注:本文中的get_feed_link函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_field函数代码示例发布时间:2022-05-15
下一篇:
PHP get_feed_access_key函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap