bp_avatar_use_webcam()

Checks whether the Webcam Avatar UI part should be loaded.


Description Description


Return Return

(bool) True to load the Webcam Avatar UI part. False otherwise.


Top ↑

Source Source

File: bp-core/bp-core-avatars.php

function bp_avatar_use_webcam() {
	global $is_safari, $is_IE, $is_chrome;

	/**
	 * Do not use the webcam feature for mobile devices
	 * to avoid possible confusions.
	 */
	if ( wp_is_mobile() ) {
		return false;
	}

	/**
	 * Bail when the browser does not support getUserMedia.
	 *
	 * @see http://caniuse.com/#feat=stream
	 */
	if ( $is_safari || $is_IE || ( $is_chrome && ! is_ssl() ) ) {
		return false;
	}

	/**
	 * Use this filter if you need to disable the webcam capture feature
	 * by returning false.
	 *
	 * @since 2.3.0
	 *
	 * @param bool $value Whether or not to load Webcam Avatar UI part.
	 */
	return apply_filters( 'bp_avatar_use_webcam', true );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.