Astra_WebFont_Loader::get_url()

Get the local URL which contains the styles.


Description

Fallback to the remote URL if we were unable to write the file locally.


Return

(string)


Source

File: inc/lib/webfont/class-astra-webfont-loader.php

	public function get_url() {

		// Check if the local stylesheet exists.
		if ( $this->local_file_exists() ) {

			// Attempt to update the stylesheet. Return the local URL on success.
			if ( $this->write_stylesheet() ) {
				return $this->get_local_stylesheet_url();
			}
		}

		$astra_font_url = file_exists( $this->get_local_stylesheet_path() ) ? $this->get_local_stylesheet_url() : $this->remote_url;

		// If the local file exists, return its URL, with a fallback to the remote URL.
		astra_update_option( 'astra_font_url', wp_json_encode( $astra_font_url ) );

		return $astra_font_url;
	}

Changelog

Changelog
Version Description
3.6.0 Introduced.

User Contributed Notes

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