Created
September 29, 2014 14:50
-
-
Save michaeljs1990/90583fe59cc8f75e0388 to your computer and use it in GitHub Desktop.
Get People Image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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