関数 do_feed()
定義ファイル :/blog/wp-includes/functions.php 6
do_feed()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | /** * Load the feed template from the use of an action hook. * * If the feed action does not have a hook, then the function will die with a * message telling the visitor that the feed is not valid. * * It is better to only have one hook for each feed. * * @since 2.1.0 * * @uses $wp_query Used to tell if the use a comment feed. */ function do_feed() { global $wp_query; $feed = get_query_var( 'feed' ); // Remove the pad, if present. $feed = preg_replace( '/^_+/', '', $feed ); if ( $feed == '' || $feed == 'feed' ) $feed = get_default_feed(); $hook = 'do_feed_' . $feed; if ( ! has_action( $hook ) ) wp_die( __( 'ERROR: This is not a valid feed template.' ), '', array( 'response' => 404 ) ); /** * Fires once the given feed is loaded. * * The dynamic hook name, $hook, refers to the feed name. * * @since 2.1.0 * * @param bool $is_comment_feed Whether the feed is a comment feed. */ do_action( $hook, $wp_query->is_comment_feed ); } |