Files
Testing/blog/wp-content/plugins/fusion-builder/inc/helpers/class-fusion-builder-border-radius-helper.php
sean 0e8a8b3028
Some checks failed
deploy-testing / deploy (push) Has been cancelled
Initial testing snapshot
2026-11-17 16:15:01 -05:00

77 lines
2.1 KiB
PHP

<?php
/**
* Avada Builder Border Radius Helper class.
*
* @package Avada-Builder
* @since 2.2
*/
// Do not allow directly accessing this file.
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Direct script access denied.' );
}
/**
* Avada Builder Border Radius Helper class.
*
* @since 2.2
*/
class Fusion_Builder_Border_Radius_Helper {
/**
* Class constructor.
*
* @since 2.2
* @access public
*/
public function __construct() {
}
/**
* Get border radius params.
*
* @static
* @access public
* @since 2.2
* @param array $args The placeholder arguments.
* @return array
*/
public static function get_params( $args ) {
return [
[
'type' => 'dimension',
'remove_from_atts' => true,
'heading' => esc_attr__( 'Border Radius', 'fusion-builder' ),
'description' => __( 'Enter values including any valid CSS unit, ex: 10px.', 'fusion-builder' ),
'param_name' => 'border_radius',
'group' => esc_attr__( 'Design', 'fusion-builder' ),
'value' => [
'border_radius_top_left' => '',
'border_radius_top_right' => '',
'border_radius_bottom_right' => '',
'border_radius_bottom_left' => '',
],
],
];
}
/**
* Checks if all border radius values are defined and adds a unit if needed.
* Sets default value if value is not set.
*
* @param array $border_radius Border radius values.
* @return array
*/
public static function get_border_radius_array_with_fallback_value( $border_radius ) {
return [
'top_left' => isset( $border_radius['top_left'] ) ? fusion_library()->sanitize->get_value_with_unit( $border_radius['top_left'] ) : '0px',
'top_right' => isset( $border_radius['top_right'] ) ? fusion_library()->sanitize->get_value_with_unit( $border_radius['top_right'] ) : '0px',
'bottom_right' => isset( $border_radius['bottom_right'] ) ? fusion_library()->sanitize->get_value_with_unit( $border_radius['bottom_right'] ) : '0px',
'bottom_left' => isset( $border_radius['bottom_left'] ) ? fusion_library()->sanitize->get_value_with_unit( $border_radius['bottom_left'] ) : '0px',
];
}
}