Skip to content

Commit

Permalink
Revert largo_get_current_url changes from #1407 while keeping DRY asp…
Browse files Browse the repository at this point in the history
…ect of url generation
  • Loading branch information
benlk committed Mar 15, 2017
1 parent e4abfe2 commit 0b608af
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions inc/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,18 @@ function largo_render_template( $slug, $name = null, $context = array() ) {
/**
* Get the current URL, including the protocol and host
*
* @since 0.5
* @since 0.5.5.4
*/
function largo_get_current_url() {
$url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
return ( ! empty( is_ssl() ) ) ? 'https://' . $url : 'http://' . $url;
}
function largo_get_current_url() {
$is_ssl = is_ssl();
$url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

if (!empty($is_ssl)) {
return "https://" . $url;
} else {
return "http://" . $url;
}
}

/**
* Return the first featured image thumbnail found in a given array of WP_Posts
Expand Down

0 comments on commit 0b608af

Please sign in to comment.