diff --git src/bp-blogs/bp-blogs-filters.php src/bp-blogs/bp-blogs-filters.php
index 7138347b1..08c65e8d4 100644
|
|
|
function bp_blogs_default_avatar( $avatar, $params ) {
|
| 158 | 158 | |
| 159 | 159 | return $avatar; |
| 160 | 160 | } |
| 161 | | add_filter( 'bp_core_avatar_default', 'bp_blogs_default_avatar', 10, 2 ); |
| | 161 | add_filter( 'bp_core_default_avatar', 'bp_blogs_default_avatar', 10, 2 ); |
| 162 | 162 | add_filter( 'bp_core_avatar_default_thumb', 'bp_blogs_default_avatar', 10, 2 ); |
| 163 | 163 | |
| 164 | 164 | /** |
diff --git src/bp-core/bp-core-avatars.php src/bp-core/bp-core-avatars.php
index 8662e1336..a44954cc2 100644
|
|
|
function bp_core_set_avatar_globals() {
|
| 95 | 95 | } |
| 96 | 96 | add_action( 'bp_setup_globals', 'bp_core_set_avatar_globals' ); |
| 97 | 97 | |
| | 98 | /** |
| | 99 | * Checks whether a given gravatar is one of the default ones. |
| | 100 | * |
| | 101 | * @since 8.0.0 |
| | 102 | * |
| | 103 | * @param string $d The name of the default gravatar. |
| | 104 | * @return bool True if it's a default gravatar. False otherwise. |
| | 105 | */ |
| | 106 | function bp_core_is_default_gravatar( $d = '' ) { |
| | 107 | if ( ! $d ) { |
| | 108 | return false; |
| | 109 | } |
| | 110 | |
| | 111 | /** this filter is documented in wp-admin/options-discussion.php */ |
| | 112 | $gravatar_defaults = apply_filters( |
| | 113 | 'avatar_defaults', |
| | 114 | array_fill_keys( |
| | 115 | array( |
| | 116 | 'mystery', |
| | 117 | 'blank', |
| | 118 | 'gravatar_default', |
| | 119 | 'identicon', |
| | 120 | 'wavatar', |
| | 121 | 'monsterid', |
| | 122 | 'retro', |
| | 123 | ), |
| | 124 | '' |
| | 125 | ) |
| | 126 | ); |
| | 127 | |
| | 128 | return isset( $gravatar_defaults[ $d ] ); |
| | 129 | } |
| | 130 | |
| 98 | 131 | /** |
| 99 | 132 | * Get an avatar for a BuddyPress object. |
| 100 | 133 | * |
| … |
… |
function bp_core_fetch_avatar( $args = '' ) {
|
| 641 | 674 | $url_args['r'] = strtolower( $params['rating'] ); |
| 642 | 675 | } |
| 643 | 676 | |
| | 677 | /** This filter is documented in wp-includes/deprecated.php */ |
| | 678 | $d = apply_filters_deprecated( |
| | 679 | 'bp_core_avatar_default', |
| | 680 | array( $default_grav, $params ), |
| | 681 | '8.0.0', |
| | 682 | 'bp_core_avatar_gravatar_default||bp_core_default_avatar', |
| | 683 | __( 'This filter was used for 2 different purposes. If your goal was to filter the default *Gravatar*, please use `bp_core_avatar_gravatar_default` instead. Otherwise, please use `bp_core_default_avatar` instead.', 'buddypress' ) |
| | 684 | ); |
| | 685 | |
| | 686 | if ( bp_core_is_default_gravatar( $d ) ) { |
| | 687 | $default_grav = $d; |
| | 688 | } |
| | 689 | |
| 644 | 690 | /** |
| 645 | 691 | * Filters the Gravatar "d" parameter. |
| 646 | 692 | * |
| 647 | 693 | * @since 2.6.0 |
| | 694 | * @since 8.0.0 The name of the filter was changed to `bp_core_avatar_gravatar_default`. |
| 648 | 695 | * |
| 649 | 696 | * @param string $default_grav The avatar default. |
| 650 | 697 | * @param array $params The avatar's data. |
| 651 | 698 | */ |
| 652 | | $default_grav = apply_filters( 'bp_core_avatar_default', $default_grav, $params ); |
| | 699 | $default_grav = apply_filters( 'bp_core_avatar_gravatar_default', $default_grav, $params ); |
| 653 | 700 | |
| 654 | 701 | // Only set default image if 'Gravatar Logo' is not requested. |
| 655 | 702 | if ( ! $params['force_default'] && 'gravatar_default' !== $default_grav ) { |
| … |
… |
function bp_core_avatar_default( $type = 'gravatar', $params = array() ) {
|
| 1838 | 1885 | $avatar = '//www.gravatar.com/avatar/00000000000000000000000000000000?d=mm&s=' . $size; |
| 1839 | 1886 | } |
| 1840 | 1887 | |
| | 1888 | /** This filter is documented in wp-includes/deprecated.php */ |
| | 1889 | $a = apply_filters_deprecated( |
| | 1890 | 'bp_core_avatar_default', |
| | 1891 | array( $avatar, $params ), |
| | 1892 | '8.0.0', |
| | 1893 | 'bp_core_avatar_gravatar_default||bp_core_default_avatar', |
| | 1894 | __( 'This filter was used for 2 different purposes. If your goal was to filter the default *Gravatar*, please use `bp_core_avatar_gravatar_default` instead. Otherwise, please use `bp_core_default_avatar` instead.', 'buddypress' ) |
| | 1895 | ); |
| | 1896 | |
| | 1897 | if ( ! bp_core_is_default_gravatar( $a ) && false !== strpos( $avatar, '//' ) ) { |
| | 1898 | $avatar = $a; |
| | 1899 | } |
| | 1900 | |
| 1841 | 1901 | /** |
| 1842 | 1902 | * Filters the URL of the 'full' default avatar. |
| 1843 | 1903 | * |
| 1844 | 1904 | * @since 1.5.0 |
| 1845 | 1905 | * @since 2.6.0 Added `$params`. |
| | 1906 | * @since 8.0.0 The name of the filter was changed to `bp_core_default_avatar`. |
| 1846 | 1907 | * |
| 1847 | 1908 | * @param string $avatar URL of the default avatar. |
| 1848 | 1909 | * @param array $params Params provided to bp_core_fetch_avatar(). |
| 1849 | 1910 | */ |
| 1850 | | return apply_filters( 'bp_core_avatar_default', $avatar, $params ); |
| | 1911 | return apply_filters( 'bp_core_default_avatar', $avatar, $params ); |
| 1851 | 1912 | } |
| 1852 | 1913 | |
| 1853 | 1914 | /** |
diff --git src/bp-groups/bp-groups-filters.php src/bp-groups/bp-groups-filters.php
index 29b424d20..58fd49377 100644
|
|
|
add_filter( 'bp_get_total_group_count_for_user', 'bp_core_number_format' );
|
| 69 | 69 | add_filter( 'bp_activity_at_name_do_notifications', 'bp_groups_disable_at_mention_notification_for_non_public_groups', 10, 4 ); |
| 70 | 70 | |
| 71 | 71 | // Default group avatar. |
| 72 | | add_filter( 'bp_core_avatar_default', 'bp_groups_default_avatar', 10, 3 ); |
| | 72 | add_filter( 'bp_core_default_avatar', 'bp_groups_default_avatar', 10, 3 ); |
| 73 | 73 | add_filter( 'bp_core_avatar_default_thumb', 'bp_groups_default_avatar', 10, 3 ); |
| 74 | 74 | |
| 75 | 75 | // Personal data export. |