bp_nouveau_get_appearance_settings( string $option = '' )

Get the BP Nouveau Appearance settings.

Description

Parameters

$option

(string) (Optional) Leave empty to get all settings, specify a value for a specific one.

Default value: ''

(mixed) (Required) An array of settings, the value of the requested setting.

Return

(array|false|mixed)

Source

File: bp-templates/bp-nouveau/includes/functions.php

function bp_nouveau_get_appearance_settings( $option = '' ) {
	$default_args = array(
		'user_nav_display'   => 0, // O is default (horizontally). 1 is vertically.
		'user_nav_order'     => array(),
		'members_layout'     => 4,
		'members_dir_tabs'   => 0,
		'members_dir_layout' => 0,
		'bp_emails'          => '',
		'user_default_tab'   => 'profile'
	);
    
    if ( bp_is_active( 'friends' ) ) {
		$default_args['members_friends_layout'] = 4;
	}

	if ( bp_is_active( 'activity' ) ) {
		$default_args['activity_dir_layout'] = 0;
		$default_args['activity_dir_tabs']   = 0; // default = no tabs
	}

	if ( bp_is_active( 'groups' ) ) {
		$default_args = array_merge( $default_args, array(
			'group_front_page'        => 1,
			'group_front_boxes'       => 1,
			'group_front_description' => 0,
			'group_nav_display'       => 0,       // O is default (horizontally). 1 is vertically.
			'group_nav_order'         => array(),
			'groups_layout'           => 4,
			'members_group_layout'    => 4,
			'groups_dir_layout'       => 0,
			'groups_dir_tabs'         => 0,
			'group_default_tab'       => 'members',
		) );
	}

	if ( is_multisite() && bp_is_active( 'blogs' ) ) {
		$default_args = array_merge( $default_args, array(
			'sites_dir_layout' => 0,
			'sites_dir_tabs'   => 0,
		) );
	}

	$settings = bp_parse_args(
		bp_get_option( 'bp_nouveau_appearance', array() ),
		$default_args,
		'nouveau_appearance_settings'
	);

	if ( ! empty( $option ) ) {
		if ( isset( $settings[ $option ] ) ) {
			return $settings[ $option ];
		} else {
			return false;
		}
	}

	return $settings;
}

Changelog

Changelog
Version Description
BuddyPress 3.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.