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_Footer_Builder_Design::sanitize_spacing( array $spacing )
Sanitize spacing settings.
Description
Parameters
- $spacing
-
(array) (Required) Spacing data to sanitize.
Return
(array) Sanitized spacing data.
Source
File: inc/abilities/customizer/footer/class-astra-update-footer-builder-design.php
private function sanitize_spacing( $spacing ) {
$sanitized = array();
$devices = array( 'desktop', 'tablet', 'mobile' );
$sides = array( 'top', 'right', 'bottom', 'left' );
foreach ( $devices as $device ) {
if ( isset( $spacing[ $device ] ) && is_array( $spacing[ $device ] ) ) {
$sanitized[ $device ] = array();
foreach ( $sides as $side ) {
if ( isset( $spacing[ $device ][ $side ] ) ) {
$sanitized[ $device ][ $side ] = sanitize_text_field( $spacing[ $device ][ $side ] );
}
}
}
$unit_key = $device . '-unit';
if ( isset( $spacing[ $unit_key ] ) ) {
$sanitized[ $unit_key ] = sanitize_text_field( $spacing[ $unit_key ] );
}
}
return $sanitized;
}
Expand full source code Collapse full source code View on Trac