Astra_Get_Sidebar::execute( array $args )
Execute the ability.
Description
Parameters
- $args
-
(array) (Required) Input arguments.
Return
(array) Result array.
Source
File: inc/abilities/customizer/general/sidebar/class-astra-get-sidebar.php
public function execute( $args ) {
$layout = astra_get_option( 'site-sidebar-layout', 'no-sidebar' );
$style = astra_get_option( 'site-sidebar-style', 'unboxed' );
$width = astra_get_option( 'site-sidebar-width', 30 );
$sticky = astra_get_option( 'site-sticky-sidebar', false );
$layout_labels = array(
'no-sidebar' => 'No Sidebar',
'left-sidebar' => 'Left Sidebar',
'right-sidebar' => 'Right Sidebar',
);
$style_labels = array(
'unboxed' => 'Unboxed',
'boxed' => 'Boxed',
);
return Astra_Abilities_Response::success(
__( 'Retrieved sidebar settings successfully.', 'astra' ),
array(
'layout' => $layout,
'layout_label' => isset( $layout_labels[ $layout ] ) ? $layout_labels[ $layout ] : $layout,
'style' => $style,
'style_label' => isset( $style_labels[ $style ] ) ? $style_labels[ $style ] : $style,
'width' => (int) $width,
'width_label' => $width . '%',
'sticky_enabled' => (bool) $sticky,
'sticky_label' => $sticky ? 'Enabled' : 'Disabled',
'available_layouts' => $layout_labels,
'available_styles' => $style_labels,
'width_range' => array(
'min' => 15,
'max' => 50,
),
)
);
}
Expand full source code Collapse full source code View on Trac