Astra_Get_Global_Buttons::execute( array $args )

Execute the ability.


Description


Parameters

$args

(array) (Required) Input arguments.


Return

(array) Result array.


Source

File: inc/abilities/customizer/globals/buttons/class-astra-get-global-buttons.php

	public function execute( $args ) {
		$preset_labels = array(
			'button_01' => 'Button 01 - Square',
			'button_02' => 'Button 02 - Rounded',
			'button_03' => 'Button 03 - Pill',
			'button_04' => 'Button 04 - Square Outline',
			'button_05' => 'Button 05 - Rounded Outline',
			'button_06' => 'Button 06 - Pill Outline',
		);

		$primary_preset   = astra_get_option( 'button-preset-style', '' );
		$secondary_preset = astra_get_option( 'secondary-button-preset-style', '' );

		return Astra_Abilities_Response::success(
			__( 'Retrieved global button settings successfully.', 'astra' ),
			array(
				'primary_button'    => array(
					'preset'                 => $primary_preset,
					'preset_label'           => isset( $preset_labels[ $primary_preset ] ) ? $preset_labels[ $primary_preset ] : '',
					'text_color'             => astra_get_option( 'button-color', '' ),
					'text_hover_color'       => astra_get_option( 'button-h-color', '' ),
					'background_color'       => astra_get_option( 'button-bg-color', '' ),
					'background_hover_color' => astra_get_option( 'button-bg-h-color', '' ),
					'border_color'           => astra_get_option( 'theme-button-border-group-border-color', '' ),
					'border_hover_color'     => astra_get_option( 'theme-button-border-group-border-h-color', '' ),
					'padding'                => astra_get_option( 'theme-button-padding', array() ),
					'border_width'           => astra_get_option( 'theme-button-border-group-border-size', array() ),
					'border_radius'          => astra_get_option( 'button-radius-fields', array() ),
				),
				'secondary_button'  => array(
					'preset'                 => $secondary_preset,
					'preset_label'           => isset( $preset_labels[ $secondary_preset ] ) ? $preset_labels[ $secondary_preset ] : '',
					'text_color'             => astra_get_option( 'secondary-button-color', '' ),
					'text_hover_color'       => astra_get_option( 'secondary-button-h-color', '' ),
					'background_color'       => astra_get_option( 'secondary-button-bg-color', '' ),
					'background_hover_color' => astra_get_option( 'secondary-button-bg-h-color', '' ),
					'border_color'           => astra_get_option( 'secondary-theme-button-border-group-border-color', '' ),
					'border_hover_color'     => astra_get_option( 'secondary-theme-button-border-group-border-h-color', '' ),
					'padding'                => astra_get_option( 'secondary-theme-button-padding', array() ),
					'border_width'           => astra_get_option( 'secondary-theme-button-border-group-border-size', array() ),
					'border_radius'          => astra_get_option( 'secondary-button-radius-fields', array() ),
				),
				'available_presets' => $preset_labels,
			)
		);
	}


User Contributed Notes

You must log in before being able to contribute a note or feedback.