当前位置: 首页>>代码示例>>PHP>>正文


PHP add_feed函数代码示例

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


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

示例1: ob_get_contents

END:VEVENT

<?php 
        }
    }
    ?>
END:VCALENDAR
<?php 
    //Collect output and echo
    $eventsical = ob_get_contents();
    ob_end_clean();
    echo $eventsical;
    exit;
}
add_feed('avignon-activities', 'avignon_activities_ical');
function activities_feed_query($query)
{
    $today = date('Ymd');
    if ($query->is_feed('avignon-activities')) {
        $query->set('post_type', 'activities');
        $query->set('posts_per_page', -1);
        $query->set('meta_key', 'date2');
        $query->set('orderby', 'meta_value_num');
        $query->set('order', 'ASC');
        //$query->set('meta_compare', '>=');
        //$query->set('meta_value', $today);
    }
}
add_action('pre_get_posts', 'activities_feed_query');
// Update feeds all 600 seconds (about 10 minutes)
开发者ID:stereosuper,项目名称:avignon-wp,代码行数:30,代码来源:ics.php

示例2: wprss_addfeed_add_feed

/**
 * Adds the custom feed, as specified by the user in the general settings.
 * 
 * @since 3.3
 */
function wprss_addfeed_add_feed()
{
    $general_settings = get_option('wprss_settings_general', 'wprss');
    if (!empty($general_settings) && isset($general_settings['custom_feed_url']) && !empty($general_settings['custom_feed_url'])) {
        $url = $general_settings['custom_feed_url'];
    } else {
        $url = $general_settings['custom_feed_url'] = 'wprss';
        update_option('wprss_settings_general', $general_settings);
    }
    // Add the feed
    add_feed($url, 'wprss_addfeed_do_feed');
    // Whether or not the feed is already registered or not
    $registered = FALSE;
    // Get all registered rewrite rules
    $rules = get_option('rewrite_rules');
    // If no rules exist, then it is not registered
    if (!is_array($rules)) {
        $registered = FALSE;
    } else {
        // Get all the array keys that match the given pattern
        // The resulting array will only contain the second part of each matching key ( $matches[1] )
        $feeds = array_keys($rules, 'index.php?&feed=$matches[1]');
        // Check if the rewrite rule for the custom feed is already registered
        foreach ($feeds as $feed) {
            if (strpos($feed, $url) !== FALSE) {
                $registered = TRUE;
            }
        }
    }
    // If not registered, flush the rewrite rules
    if (!$registered) {
        flush_rewrite_rules();
    }
}
开发者ID:marinabalan,项目名称:votezinformat,代码行数:39,代码来源:custom-feed.php

示例3: add_eventlist_feed

 public function add_eventlist_feed()
 {
     global $wp_rewrite;
     add_feed('eventlist', array(&$this, 'print_eventlist_feed'));
     add_action('generate_rewrite_rules', array(&$this, 'eventlist_feed_rewrite'));
     $wp_rewrite->flush_rules();
 }
开发者ID:geekpondering,项目名称:wtg,代码行数:7,代码来源:feed.php

示例4: init

 public function init()
 {
     add_feed($this->options->get('el_feed_name'), array(&$this, 'print_eventlist_feed'));
     if ($this->options->get('el_head_feed_link')) {
         add_action('wp_head', array(&$this, 'print_head_feed_link'));
     }
 }
开发者ID:berniecultess,项目名称:infirev,代码行数:7,代码来源:feed.php

示例5: init

 function init()
 {
     // Load language pack
     load_theme_textdomain('p2', get_template_directory() . '/languages');
     // Set up the AJAX read handler
     add_feed('p2.ajax', array($this, 'ajax_read'));
 }
开发者ID:cabelotaina,项目名称:redelivre,代码行数:7,代码来源:functions.php

示例6: rssmi_rss

function rssmi_rss()
{
    $feed_options = get_option('rss_feed_options', 'option not found');
    if (!empty($feed_options) && isset($feed_options['feedslug'])) {
        add_feed($feed_options['feedslug'], 'rssmi_feed');
    }
}
开发者ID:adams0917,项目名称:woocommerce_eht,代码行数:7,代码来源:rss_feed.php

示例7: load

 public static function load()
 {
     if (is_network_admin()) {
         self::$is_network_feed = true;
     }
     if (!is_admin()) {
         $feed_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
         if (self::FEED_NETWORK_QUERY_VAR === basename($feed_path)) {
             self::$is_network_feed = true;
         }
     }
     if (!self::$is_network_feed) {
         if (!isset(WP_Stream_Settings::$options['general_private_feeds']) || !WP_Stream_Settings::$options['general_private_feeds']) {
             return;
         }
     }
     add_action('show_user_profile', array(__CLASS__, 'save_user_feed_key'));
     add_action('edit_user_profile', array(__CLASS__, 'save_user_feed_key'));
     add_action('show_user_profile', array(__CLASS__, 'user_feed_key'));
     add_action('edit_user_profile', array(__CLASS__, 'user_feed_key'));
     // Generate new Stream Feed Key
     add_action('wp_ajax_wp_stream_feed_key_generate', array(__CLASS__, 'generate_user_feed_key'));
     add_feed(self::FEED_QUERY_VAR, array(__CLASS__, 'feed_template'));
     add_feed(self::FEED_NETWORK_QUERY_VAR, array(__CLASS__, 'feed_template'));
 }
开发者ID:Magnacarter,项目名称:livinghope.com,代码行数:25,代码来源:class-wp-stream-feeds.php

示例8: eventorganiser_public_export

function eventorganiser_public_export()
{
    $eo_settings = get_option('eventorganiser_options');
    if (!empty($eo_settings['feed'])) {
        add_feed('eo-events', array('Event_Organiser_Im_Export', 'get_object'));
    }
}
开发者ID:rashadrussell,项目名称:UIUC_WebMonkeys_Website,代码行数:7,代码来源:event-organiser-register.php

示例9: bfox_plans_create_post_type

function bfox_plans_create_post_type()
{
    //TODO: add plans directory template archive - see: http://www.ballyhooblog.com/custom-post-types-wordpress-30-with-template-archives/
    register_post_type('bfox_plan', array('description' => __('Bible Reading Plans', 'bfox'), 'labels' => array('name' => __('Reading Plans', 'bfox'), 'singular_name' => __('Reading Plan', 'bfox'), 'edit_item' => __('Edit Reading Plan', 'bfox'), 'new_item' => __('New Reading Plan', 'bfox'), 'view_item' => __('View Reading Plan', 'bfox'), 'parent_item_colon' => __('Parent Plan:', 'bfox')), 'public' => true, 'rewrite' => array('slug' => 'reading-plans'), 'hierarchical' => true, 'supports' => array('title', 'excerpt', 'revisions', 'thumbnail'), 'register_meta_box_cb' => 'bfox_plans_register_meta_box_cb'));
    add_feed('readings-rss', 'bfox_plan_do_feed_readings');
    add_feed('readings-ical', 'bfox_plan_do_feed_readings');
}
开发者ID:jeffryevans,项目名称:biblefox-wp,代码行数:7,代码来源:bfox_plan.php

示例10: request_feed

 function request_feed()
 {
     global $wp_rewrite;
     add_feed('feedforward', array($this, 'all_feed_assembler'));
     # Called because stated requirement at http://codex.wordpress.org/Rewrite_API/add_feed
     # Called as per http://codex.wordpress.org/Rewrite_API/flush_rules
     #$wp_rewrite->flush_rules(false);
 }
开发者ID:dangeles,项目名称:Phinch,代码行数:8,代码来源:rss-out.php

示例11: bgnp_init_rss_feeds

function bgnp_init_rss_feeds()
{
    // Get option to be used as section-based Editors’ Picks RSS feed slug
    $bgnp_sec_feed_cat = get_option('bgnp_sec_feed_cat');
    //initialize the homepage and section-based news feeds
    add_feed('editors-picks', 'bgnp_do_rss_feed');
    add_feed('editors-picks-' . $bgnp_sec_feed_cat, 'bgnp_do_sec_feed');
}
开发者ID:erikdukker,项目名称:medisom,代码行数:8,代码来源:bgnp-functions.php

示例12: my_calendar_add_feed

function my_calendar_add_feed()
{
    global $wp_rewrite, $wpdb;
    $mcdb = $wpdb;
    add_feed('my-calendar-rss', 'my_calendar_rss');
    add_feed('my-calendar-ics', 'my_calendar_ical');
    add_feed('my-calendar-print', 'my_calendar_print');
}
开发者ID:newmight2015,项目名称:psmpsm,代码行数:8,代码来源:my-calendar-core.php

示例13: init_diamondPF

 function init_diamondPF()
 {
     $address = get_option('diamond_feed_address');
     if (!$address || $address == '') {
         $address = 'networkrss';
     }
     add_feed('networkrss', array($this, 'diamond_post_create_feed'));
 }
开发者ID:Wikipraca,项目名称:Wikipraca-WikiSquare,代码行数:8,代码来源:diamond-post-feed.php

示例14: add_podcast_feeds

 public function add_podcast_feeds()
 {
     add_feed('pod', array($this, 'do_podcast_feed'));
     $extensions = $this->model->get_file_extensions();
     foreach ($extensions as $mime => $ext) {
         add_feed($ext, array($this, 'do_podcast_feed'));
     }
 }
开发者ID:ICFMovement,项目名称:dicentis,代码行数:8,代码来源:class-dipo-rss-controller.php

示例15: init

 /**
  * Initialise WP Geo feeds
  */
 function init()
 {
     // Add GeoRSS Feed Type
     add_feed('georss', array('WPGeo_Feeds', 'add_feed_georss'));
     add_filter('feed_content_type', array($this, 'feed_content_type'), 100);
     add_filter('post_limits', array($this, 'post_limits'));
     $this->add_feed_hooks();
 }
开发者ID:bangjojo,项目名称:wp,代码行数:11,代码来源:feeds.php


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