bp_attachments_get_cover_image_dimensions( string $component = 'members' )

Get cover image Width and Height.


Description Description


Parameters Parameters

$component

(Optional) The BuddyPress component concerned ("members" for user or "groups").

Default value: 'members'


Top ↑

Return Return

(array|bool) An associative array containing the advised width and height for the cover image. False if settings are empty.


Top ↑

Source Source

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

function bp_attachments_get_cover_image_dimensions( $component = 'xprofile' ) {
	// Let's prevent notices when setting the warning strings.
	$default = array( 'width' => 0, 'height' => 0 );

	$settings = bp_attachments_get_cover_image_settings( $component );

	if ( empty( $settings ) ) {
		return false;
	}

	// Get width and height.
	$wh = array_intersect_key( $settings, $default );

	/**
	 * Filter here to edit the cover image dimensions if needed.
	 *
	 * @since 2.4.0
	 *
	 * @param array  $wh       An associative array containing the width and height values.
	 * @param array  $settings An associative array containing all the feature settings.
	 * @param string $compnent The requested component.
	 */
	return apply_filters( 'bp_attachments_get_cover_image_dimensions', $wh, $settings, $component );
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.4.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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