This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Astra_Update_Header_Builder_Design::sanitize_background( array $background )
Sanitize background settings.
Description
Parameters
- $background
-
(array) (Required) Background data.
Return
(array) Sanitized background data.
Source
File: inc/abilities/customizer/header/class-astra-update-header-builder-design.php
private function sanitize_background( $background ) {
$sanitized = array();
$devices = array( 'desktop', 'tablet', 'mobile' );
foreach ( $devices as $device ) {
if ( isset( $background[ $device ] ) && is_array( $background[ $device ] ) ) {
$sanitized[ $device ] = array();
$allowed_keys = array(
'background-color',
'background-image',
'background-repeat',
'background-position',
'background-size',
'background-attachment',
'background-media',
'background-type',
'overlay-type',
'overlay-color',
'overlay-gradient',
);
foreach ( $allowed_keys as $key ) {
if ( isset( $background[ $device ][ $key ] ) ) {
$sanitized[ $device ][ $key ] = sanitize_text_field( $background[ $device ][ $key ] );
}
}
}
}
return $sanitized;
}
Expand full source code Collapse full source code View on Trac