Changeset 10721 for trunk/src/bp-core/bp-core-avatars.php
- Timestamp:
- 04/27/2016 03:59:26 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-avatars.php
r10688 r10721 176 176 * case 'no_grav' should be set to true. To disable Gravatar 177 177 * fallbacks globally, see the 'bp_core_fetch_avatar_no_grav' filter. 178 * Default: false.178 * Default: true for groups, otherwise false. 179 179 * @type bool $html Whether to return an <img> HTML element, vs a raw URL 180 180 * to an avatar. If false, <img>-specific arguments (like 'css_id') … … 212 212 'alt' => '', 213 213 'email' => false, 214 'no_grav' => false,214 'no_grav' => null, 215 215 'html' => true, 216 216 'title' => '', … … 565 565 } 566 566 567 // By default, Gravatar is not pinged for groups. 568 if ( null === $params['no_grav'] ) { 569 $params['no_grav'] = 'group' === $params['object']; 570 } 571 567 572 /** 568 573 * Filters whether or not to skip Gravatar check. … … 672 677 * @param array $params Array of parameters for the avatar request. 673 678 */ 674 $gravatar = apply_filters( 'bp_core_default_avatar_' . $params['object'], bp_core_avatar_default( 'local' ), $params );679 $gravatar = apply_filters( 'bp_core_default_avatar_' . $params['object'], bp_core_avatar_default( 'local', $params ), $params ); 675 680 } 676 681 … … 1846 1851 * 1847 1852 * @since 1.5.0 1848 * 1849 * @param string $type 'local' if the fallback should be the locally-hosted version 1850 * of the mystery-person, 'gravatar' if the fallback should be 1851 * Gravatar's version. Default: 'gravatar'. 1853 * @since 2.6.0 Introduced `$params` and `$object_type` parameters. 1854 * 1855 * @param string $type 'local' if the fallback should be the locally-hosted version 1856 * of the mystery person, 'gravatar' if the fallback should be 1857 * Gravatar's version. Default: 'gravatar'. 1858 * @param array $params Parameters passed to bp_core_fetch_avatar(). 1852 1859 * @return string The URL of the default avatar. 1853 1860 */ 1854 function bp_core_avatar_default( $type = 'gravatar' ) {1861 function bp_core_avatar_default( $type = 'gravatar', $params = array() ) { 1855 1862 // Local override. 1856 1863 if ( defined( 'BP_AVATAR_DEFAULT' ) ) { … … 1870 1877 * 1871 1878 * @since 1.5.0 1879 * @since 2.6.0 Added `$params`. 1872 1880 * 1873 1881 * @param string $avatar URL of the default avatar. 1874 */ 1875 return apply_filters( 'bp_core_avatar_default', $avatar ); 1882 * @param array $params Params provided to bp_core_fetch_avatar(). 1883 */ 1884 return apply_filters( 'bp_core_avatar_default', $avatar, $params ); 1876 1885 } 1877 1886 … … 1883 1892 * 1884 1893 * @since 1.5.0 1885 * 1886 * @param string $type 'local' if the fallback should be the locally-hosted version 1887 * of the mystery-person, 'gravatar' if the fallback should be 1888 * Gravatar's version. Default: 'gravatar'. 1894 * @since 2.6.0 Introduced `$object_type` parameter. 1895 * 1896 * @param string $type 'local' if the fallback should be the locally-hosted version 1897 * of the mystery person, 'gravatar' if the fallback should be 1898 * Gravatar's version. Default: 'gravatar'. 1899 * @param array $params Parameters passed to bp_core_fetch_avatar(). 1889 1900 * @return string The URL of the default avatar thumb. 1890 1901 */ 1891 function bp_core_avatar_default_thumb( $type = 'gravatar' ) {1902 function bp_core_avatar_default_thumb( $type = 'gravatar', $params = array() ) { 1892 1903 // Local override. 1893 1904 if ( defined( 'BP_AVATAR_DEFAULT_THUMB' ) ) { … … 1907 1918 * 1908 1919 * @since 1.5.0 1920 * @since 2.6.0 Added `$params`. 1909 1921 * 1910 1922 * @param string $avatar URL of the default avatar. 1911 */ 1912 return apply_filters( 'bp_core_avatar_thumb', $avatar ); 1923 * @param string $params Params provided to bp_core_fetch_avatar(). 1924 */ 1925 return apply_filters( 'bp_core_avatar_thumb', $avatar, $params ); 1913 1926 } 1914 1927
Note: See TracChangeset
for help on using the changeset viewer.