Skip to content

Instantly share code, notes, and snippets.

@michaeljs1990
Created September 29, 2014 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michaeljs1990/90583fe59cc8f75e0388 to your computer and use it in GitHub Desktop.
Save michaeljs1990/90583fe59cc8f75e0388 to your computer and use it in GitHub Desktop.
Get People Image
<?php
list($titan, $options) = uwmpeople_get_plugin_options();
// By default, let's try to get the profile photo. This may return an integer
// or a URL. Thanks WordPress. If profile photo is empty, then we set it to
// default image, which ALSO might be an integer or a URL. Hopefully this covers all cases.
$featured_image = $titan->getOption('profile_photo', $post_id);
if ( empty($featured_image) )
$featured_image = $titan->getOption('default_image');
if ( strpos($featured_image, 'http' ) === false )
$featured_image = wp_get_attachment_url( $featured_image );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment