Could anyone help me translate this code to plain English?

  • Tonz
  • Born
  • Born
  • Tonz
  • Posts: 2

Post 3+ Months Ago

I've been having trouble with making some changes to my website. Could you help me understand this code a bit more so that I can figure out this small or large issue ive been having. I am still learning.
Code: [ Select ]
/// Links

function gbs_feed_link( $context = '' )
{
    if ( empty($context) ) {
        $context = $_COOKIE[ 'your-selected-location' ];
    }
    if ( !empty($context) && !is_home() && !is_front_page() ) {
        if ( get_option('permalink_structure') != '' ) {
            global $wp_rewrite;
            $rewrite_prestructure = $wp_rewrite->front;
            if ( !empty($rewrite_prestructure) ) {
                return site_url( $rewrite_prestructure . 'deals/' . $context . '/feed/');
            }
            $feed_link = site_url('/deals/' . $context . '/feed/');
        } else {
            $feed_link = add_query_arg( array( 'deals' => $context, 'post_type' => 'deal' ), get_bloginfo('rss2_url') );
        }
    } else {
        $feed_link = get_bloginfo('rss2_url');
    }
    return apply_filters('gbs_feed_link', $feed_link, $context );
}
  1. /// Links
  2. function gbs_feed_link( $context = '' )
  3. {
  4.     if ( empty($context) ) {
  5.         $context = $_COOKIE[ 'your-selected-location' ];
  6.     }
  7.     if ( !empty($context) && !is_home() && !is_front_page() ) {
  8.         if ( get_option('permalink_structure') != '' ) {
  9.             global $wp_rewrite;
  10.             $rewrite_prestructure = $wp_rewrite->front;
  11.             if ( !empty($rewrite_prestructure) ) {
  12.                 return site_url( $rewrite_prestructure . 'deals/' . $context . '/feed/');
  13.             }
  14.             $feed_link = site_url('/deals/' . $context . '/feed/');
  15.         } else {
  16.             $feed_link = add_query_arg( array( 'deals' => $context, 'post_type' => 'deal' ), get_bloginfo('rss2_url') );
  17.         }
  18.     } else {
  19.         $feed_link = get_bloginfo('rss2_url');
  20.     }
  21.     return apply_filters('gbs_feed_link', $feed_link, $context );
  22. }
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 122 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.