Skip to content

Instantly share code, notes, and snippets.

@KaineLabs
Last active January 22, 2021 05:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KaineLabs/bafba11055b8414d9757e05159c58a0d to your computer and use it in GitHub Desktop.
Save KaineLabs/bafba11055b8414d9757e05159c58a0d to your computer and use it in GitHub Desktop.
Sync About Me Widget
<?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