-
Notifications
You must be signed in to change notification settings - Fork 6
Hooks—Media Backgrounds
ucfwp_get_media_background_picture_srcsucfwp_media_background_picture_object_positionucfwp_media_background_video_object_positionucfwp_media_background_video_viewport_min_width
Returns an array of srcs for a media background picture's inner <source>s by breakpoint.
-
$bg_imagesarrayAssociative array of size names and their respective image urls. Expected format:
array( 'xs' => '', 'sm' => '', 'md' => '', 'lg' => '', 'xl' => '', 'fallback' => '' )
The unique key 'fallback' is used in the theme as the fallback
<img> srcwithin the generated<picture>element for browsers that don't support the<picture>tag.$bg_images['fallback']is required for the theme to generate a media background picture.
array: Associative array of size names and their respective image urls.
Allows the object-position property of media background pictures generated by the theme to be adjusted.
NOTE: this hook helps make the necessary data attribute markup changes within media background pictures to support custom object-positioning, but child themes must also provide a style override to .media-background to completely apply their desired changes. See the Athena Framework documentation on media background object-positioning for more info.
-
$positionstring
string: A valid object-position value.
Allows the object-position property of media background videos generated by the theme to be adjusted.
NOTE: this hook helps make the necessary data attribute markup changes within media background videos to support custom object-positioning, but child themes must also provide a style override to .media-background-video to completely apply their desired changes. See the Athena Framework documentation on media background object-positioning for more info.
-
$widthstring
string: A valid object-position value.
Allows adjustment of the minimum screen size at which media background videos should be loaded.
NOTE: by default, this theme disables loading of background videos at Athena's -xs breakpoint (below 576px wide). While this option is available for flexibility, we don't recommend changing this value for performance reasons.
-
$widthintA minimum browser viewport width, in pixels, that media background videos should be loaded in.
int: Viewport width, in pixels