Changeset 9755 for trunk/src/bp-core/bp-core-avatars.php
- Timestamp:
- 04/16/2015 10:11:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-avatars.php
r9740 r9755 1374 1374 } 1375 1375 add_action( 'bp_parse_query', 'bp_core_avatar_reset_query', 10, 1 ); 1376 1377 /** 1378 * Checks whether Avatar UI should be loaded 1379 * 1380 * @since BuddyPress (2.3.0) 1381 * 1382 * @return bool True if Avatar UI should load, false otherwise 1383 */ 1384 function bp_avatar_is_front_edit() { 1385 $retval = false; 1386 1387 if ( bp_is_user_change_avatar() && 'crop-image' !== bp_get_avatar_admin_step() ) { 1388 $retval = ! bp_core_get_root_option( 'bp-disable-avatar-uploads' ); 1389 } 1390 1391 if ( bp_is_active( 'groups' ) ) { 1392 // Group creation 1393 if ( bp_is_group_create() && bp_is_group_creation_step( 'group-avatar' ) && 'crop-image' !== bp_get_avatar_admin_step() ) { 1394 $retval = ! bp_core_get_root_option( 'bp-disable-avatar-uploads' ); 1395 1396 // Group Manage 1397 } elseif ( bp_is_group_admin_page() && bp_is_group_admin_screen( 'group-avatar' ) && 'crop-image' !== bp_get_avatar_admin_step() ) { 1398 $retval = ! bp_core_get_root_option( 'bp-disable-avatar-uploads' ); 1399 } 1400 } 1401 1402 /** 1403 * Use this filter if you need to : 1404 * - Load the avatar UI for a component that is !groups or !user (return true regarding your conditions) 1405 * - Completely disable the avatar UI introduced in 2.3 (eg: __return_false()) 1406 * 1407 * @since BuddyPress (2.3.0) 1408 * 1409 * @var bool whether to load the Avatar UI 1410 */ 1411 return apply_filters( 'bp_avatar_is_front_edit', $retval ); 1412 } 1413 1414 /** 1415 * Checks whether the Webcam Avatar UI part should be loaded 1416 * 1417 * @since BuddyPress (2.3.0) 1418 * 1419 * @return bool True to load the Webcam Avatar UI part. False otherwise. 1420 */ 1421 function bp_avatar_use_webcam() { 1422 /** 1423 * Do not use the webcam feature for mobile devices 1424 * to avoid possible confusions. 1425 */ 1426 if ( wp_is_mobile() ) { 1427 return false; 1428 } 1429 1430 /** 1431 * Use this filter if you need to disable the webcam capture feature 1432 * by returning false. 1433 * 1434 * @since BuddyPress (2.3.0) 1435 * 1436 * @var bool whether to load Webcam Avatar UI part 1437 */ 1438 return apply_filters( 'bp_avatar_use_webcam', true ); 1439 }
Note: See TracChangeset
for help on using the changeset viewer.