• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Genesis Theme Framework a2z

Genesis Theme Framework a2z

WordPress Dynamic API Reference

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / genesis_feed_redirect() – Redirect the browser to the custom feed URI.

You appear to be a bot. Output may be restricted

Description

Redirect the browser to the custom feed URI.

Exits PHP after redirect.

Usage

$void = genesis_feed_redirect();

Parameters

Returns

void Return early if is feed user agent is set and matches Feedblitz, Feedburner or Feedvalidator. Redirects and exits on success.

Source

File name: genesis/lib/functions/feed.php


Lines:

1 to 27 of 27
function genesis_feed_redirect() {

  if ( ! is_feed() || ( isset( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/feed(blitz|burner|validator)/i', $_SERVER['HTTP_USER_AGENT'] ) ) ) {
    return;
  }

  // Don't redirect if viewing archive, search, or post comments feed.
  if ( is_archive() || is_search() || is_singular() ) {
    return;
  }

  $feed_uri          = genesis_get_option( 'feed_uri' );
  $comments_feed_uri = genesis_get_option( 'comments_feed_uri' );

  if ( $feed_uri && ! is_comment_feed() && genesis_get_option( 'redirect_feed' ) ) {
    wp_redirect( $feed_uri, 302 ); // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect -- User inputs redirect URL.
    exit;
  }

  if ( $comments_feed_uri && is_comment_feed() && genesis_get_option( 'redirect_comments_feed' ) ) {
    wp_redirect( $comments_feed_uri, 302 ); // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect -- User inputs redirect URL.
    exit;
  }

}
 

Published: 25th November 2019 | Last updated: 25th November 2019

Primary Sidebar

Information

Function name: genesis_feed_redirect
Plugin ref: Genesis Framework
Version: 3.3.3
Sourcefile: lib/functions/feed.php
File ref: lib/functions/feed.php
Deprecated?: No
API Letters: F,G,R

Footer

Genesis a2z
Genesis Theme Framework a2z
WordPress Dynamic API Reference
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  genesis.wp-a2z.org
© Copyright Genesis a2z 2014-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites