Astra_Get_Load_Google_Fonts_Locally::execute( array $args )

Execute the ability.


Description


Parameters

$args

(array) (Required) Input arguments.


Return

(array) Result array.


Source

File: inc/abilities/admin/settings/performance/class-astra-get-load-google-fonts-locally.php

	public function execute( $args ) {
		if ( ! defined( 'ASTRA_THEME_SETTINGS' ) ) {
			return Astra_Abilities_Response::error(
				__( 'Astra theme is not active.', 'astra' ),
				__( 'Please activate the Astra theme to use this feature.', 'astra' )
			);
		}

		if ( ! class_exists( 'Astra_API_Init' ) ) {
			return Astra_Abilities_Response::error(
				__( 'Astra API not available.', 'astra' ),
				__( 'Please ensure Astra theme is properly loaded.', 'astra' )
			);
		}

		$enabled = Astra_API_Init::get_admin_settings_option( 'self_hosted_gfonts', false );

		return Astra_Abilities_Response::success(
			__( 'Retrieved Load Google Fonts Locally status successfully.', 'astra' ),
			array(
				'enabled'       => (bool) $enabled,
				'enabled_label' => $enabled ? 'Enabled' : 'Disabled',
			)
		);
	}


User Contributed Notes

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