bp_nouveau_get_appearance_settings( string $option = '' )

Get the BP Nouveau Appearance settings.


Parameters 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.


Top ↑

Return Return

(array|false|mixed)


Source Source

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

function bp_nouveau_get_appearance_settings( $option = '' ) {
	$default_args = array(
		'avatar_style'       => 0,
		'global_alignment'   => 'alignwide',
		'user_front_page'    => 1,
		'user_front_bio'     => 0,
		'user_nav_display'   => 0, // O is default (horizontally). 1 is vertically.
		'user_nav_tabs'      => 0,
		'user_subnav_tabs'   => 0,
		'user_nav_order'     => array(),
		'members_layout'     => 1,
		'members_dir_tabs'   => 0,
		'members_dir_layout' => 0,
	);

	if ( bp_is_active( 'friends' ) ) {
		$default_args['members_friends_layout'] = 1;
	}

	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(),
			'group_nav_tabs'          => 0,
			'group_subnav_tabs'       => 0,
			'groups_create_tabs'      => 1,
			'groups_layout'           => 1,
			'members_group_layout'    => 1,
			'groups_dir_layout'       => 0,
			'groups_dir_tabs'         => 0,
		) );
	}

	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;
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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