bp_attachments_get_cover_image_dimensions( string $component = 'xprofile' )
Get cover photo Width and Height.
Description
Parameters
- $component
-
(Optional) The BuddyPress component concerned ("xprofile" for user or "groups").
Default value: 'xprofile'
Return
(array|bool) An associative array containing the advised width and height for the cover photo. False if settings are empty.
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 photo dimensions if needed.
*
* @since BuddyPress 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 );
}
Changelog
| Version | Description |
|---|---|
| BuddyPress 2.4.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.