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'
Return Return
(array|bool) An associative array containing the advised width and height for the cover image. False if settings are empty.
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 ); }
Changelog Changelog
Version | Description |
---|---|
2.4.0 | Introduced. |