Skip to content

Instantly share code, notes, and snippets.

@mattonomics
Created April 24, 2012 17:51
Show Gist options
  • Save mattonomics/2481989 to your computer and use it in GitHub Desktop.
Save mattonomics/2481989 to your computer and use it in GitHub Desktop.
Get Thesis Header URL
<?php
// use thesis_header_url() to echo the URL and thesis_header_url(false) to simply return it
function thesis_get_header_url($echo = true) {
if (! $option = get_option('thesis_header') || ! is_array($option) || ! isset($option['url']) || empty($option['url']))
return;
if ($echo)
echo esc_url($option['url']);
else
return $option['url']; // please escape this with esc_url() before you echo it
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment