function pugpig_ad_bundle_pugpig_get_content_html_url($url, $post, $edition_id) { if (isset($post) && $post->post_type == PUGPIG_AD_BUNDLE_POST_TYPE) { return pugpig_ad_bundle_url($post); } return $url; }
function pugpig_get_canonical_url($post) { $url = ''; // Ad bundles should return the path to the actual bundle HTML file - not the slug URL which then results in a redirect // (and a different relative URL to the ad bundle contents) if (isset($post) && $post->post_type == PUGPIG_AD_BUNDLE_POST_TYPE) { $url = pugpig_ad_bundle_url($post); } else { $url = pugpig_permalink(pugpig_get_permalink($post)); } if (substr($url, 0, 4) !== 'http') { $root_url = parse_url(get_bloginfo('url')); return $root_url['scheme'] . '://' . $root_url['host'] . (isset($root_url['port']) ? ':' . $root_url['port'] : '') . $url; } else { return $url; } }