bp_media_get_settings_fields()

Get all of the settings fields.

Description

Return

(array)

Source

File: bp-media/bp-media-settings.php

function bp_media_get_settings_fields() {

	$fields = [];

	/** Photos Section ******************************************************/
	$fields['bp_media_settings_photos'] = [

        'bp_media_profile_media_support' => [
			'title'             => __( 'Profiles', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_profile_media_support',
			'sanitize_callback' => 'absint',
			'args'              => []
		],

        'bp_media_profile_albums_support' => [
	        'title'             => __( 'Profile Albums', 'buddyboss' ),
	        'callback'          => '__return_true',
	        'sanitize_callback' => 'absint',
	        'args'              => [
		        'class' => 'hidden'
	        ]
        ],
	];

	$fields['bp_media_settings_emoji'] = [

		'bp_media_profiles_emoji_support' => [
			'title'             => __( 'Profiles', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_profiles_emoji_support',
			'sanitize_callback' => 'absint',
			'args'              => []
		],
	];

	$fields['bp_media_settings_gifs'] = [

		'bp_media_gif_api_key' => [
			'title'             => __( 'GIPHY API Key', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_gif_key',
			'sanitize_callback' => 'string',
			'args'              => []
		],

		'bp_media_profiles_gif_support' => [
			'title'             => __( 'Profiles', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_profiles_gif_support',
			'sanitize_callback' => 'absint',
			'args'              => []
		],
	];

	if ( bp_is_active( 'groups' ) ) {

		$fields['bp_media_settings_photos']['bp_media_group_media_support'] = [
			'title'             => __( 'Groups', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_group_media_support',
			'sanitize_callback' => 'absint',
			'args'              => []
		];

		$fields['bp_media_settings_photos']['bp_media_group_albums_support'] = [
			'title'             => __( 'Group Albums', 'buddyboss' ),
			'callback'          => '__return_true',
			'sanitize_callback' => 'absint',
			'args'              => [
				'class' => 'hidden'
			]
		];

		$fields['bp_media_settings_emoji']['bp_media_groups_emoji_support'] = [
			'title'             => __( 'Groups', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_groups_emoji_support',
			'sanitize_callback' => 'absint',
			'args'              => []
		];

		$fields['bp_media_settings_gifs']['bp_media_groups_gif_support'] = [
			'title'             => __( 'Groups', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_groups_gif_support',
			'sanitize_callback' => 'absint',
			'args'              => []
		];
	}

	if ( bp_is_active( 'messages' ) ) {

		$fields['bp_media_settings_photos']['bp_media_messages_media_support'] = [
			'title'             => __( 'Messages', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_messages_media_support',
			'sanitize_callback' => 'absint',
			'args'              => []
		];

		$fields['bp_media_settings_emoji']['bp_media_messages_emoji_support'] = [
			'title'             => __( 'Messages', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_messages_emoji_support',
			'sanitize_callback' => 'absint',
			'args'              => []
		];

		$fields['bp_media_settings_gifs']['bp_media_messages_gif_support'] = [
			'title'             => __( 'Messages', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_messages_gif_support',
			'sanitize_callback' => 'absint',
			'args'              => []
		];
	}

	if ( bp_is_active( 'forums' ) ) {

		$fields['bp_media_settings_photos']['bp_media_forums_media_support'] = [
			'title'             => __( 'Forums', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_forums_media_support',
			'sanitize_callback' => 'absint',
			'args'              => []
		];

		$fields['bp_media_settings_emoji']['bp_media_forums_emoji_support'] = [
			'title'             => __( 'Forums', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_forums_emoji_support',
			'sanitize_callback' => 'absint',
			'args'              => []
		];

		$fields['bp_media_settings_gifs']['bp_media_forums_gif_support'] = [
			'title'             => __( 'Forums', 'buddyboss' ),
			'callback'          => 'bp_media_settings_callback_forums_gif_support',
			'sanitize_callback' => 'absint',
			'args'              => []
		];
	}

	$fields['bp_media_settings_photos']['bp_photo_uploading_tutorial'] = [
		'title'             => __( ' ', 'buddyboss' ),
		'callback'          => 'bp_photo_uploading_tutorial',
	];

	$fields['bp_media_settings_emoji']['bp_emoji_tutorial'] = [
		'title'             => __( ' ', 'buddyboss' ),
		'callback'          => 'bp_emoji_tutorial',
	];

	$fields['bp_media_settings_gifs']['bp_animated_gifs_tutorial'] = [
		'title'             => __( ' ', 'buddyboss' ),
		'callback'          => 'bp_animated_gifs_tutorial',
	];

	return (array) apply_filters( 'bp_media_get_settings_fields', $fields );
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.