From 378494daa995fd0c86ed07968783b3add5a636b1 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Thu, 8 Sep 2016 20:07:36 +0800 Subject: [PATCH] Adds a filter hook to modify cover photo uri --- core/um-short-functions.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/um-short-functions.php b/core/um-short-functions.php index 69fbde5c..b7cde551 100644 --- a/core/um-short-functions.php +++ b/core/um-short-functions.php @@ -1581,13 +1581,19 @@ function um_fetch_user( $user_id ) { break; case 'cover_photo': + + $is_default = false; + if ( um_profile('cover_photo') ) { $cover_uri = um_get_cover_uri( um_profile('cover_photo'), $attrs ); } else if( um_profile('synced_cover_photo') ) { $cover_uri = um_profile('synced_cover_photo'); }else{ $cover_uri = um_get_default_cover_uri(); + $is_default = true; } + + $cover_uri = apply_filters('um_user_cover_photo_uri__filter', $cover_uri, $is_default, $attrs ); if ( $cover_uri ) return '';