Last active
January 22, 2021 05:03
-
-
Save KaineLabs/bafba11055b8414d9757e05159c58a0d to your computer and use it in GitHub Desktop.
Sync About Me Widget
This file contains 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 | |
/** | |
* Sync About Me Widget - Image. | |
*/ | |
function yzc_sync_profile_about_me_widget_image( $photo_url = null, $user_id ) { | |
if ( ! empty( $photo_url ) || bp_is_current_component( 'widgets' ) ) { | |
return $photo_url; | |
} | |
return bp_core_fetch_avatar( | |
array( | |
'item_id' => $user_id, | |
'type' => 'full', | |
"html" => false | |
) | |
); | |
} | |
add_filter( 'get_the_author_wg_about_me_photo', 'yzc_sync_profile_about_me_widget_image', 10, 2 ); | |
add_filter( 'get_the_author_youzify_wg_about_me_photo', 'yzc_sync_profile_about_me_widget_image', 10, 2 ); | |
/** | |
* Sync About Me Widget - BIO. | |
*/ | |
function yzc_sync_profile_about_me_widget_bio( $bio = null, $user_id ) { | |
if ( ! empty( $bio ) ) { | |
return $bio; | |
} | |
return get_the_author_meta( 'description', $user_id ); | |
} | |
add_filter( 'get_the_author_wg_about_me_bio', 'yzc_sync_profile_about_me_widget_bio', 10, 2 ); | |
add_filter( 'get_the_author_youzify_wg_about_me_bio', 'yzc_sync_profile_about_me_widget_bio', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment