packages/kirki-framework/googlefonts/src/GoogleFonts.php
public function get_google_fonts_by_args( $args = [] ) {
		$cache_name = 'kirki_googlefonts_' . md5( wp_json_encode( $args ) );
		$cache      = get_site_transient( $cache_name );
		if ( $cache ) {
			return $cache;
		}

		$args['sort'] = isset( $args['sort'] ) ? $args['sort'] : 'alpha';

		$fonts         = $this->get_array();
		$ordered_fonts = $fonts['order'][ $args['sort'] ];
		if ( isset( $args['count'] ) ) {
			set_site_transient( $cache_name, $ordered_fonts, HOUR_IN_SECONDS );
			$ordered_fonts = array_slice( $ordered_fonts, 0, $args['count'] );
			return $ordered_fonts;
		}
		set_site_transient( $cache_name, $ordered_fonts, HOUR_IN_SECONDS );
		return $ordered_fonts;
	}
public function get_google_fonts_by_args( $args = [] ) {
		$cache_name = 'kirki_googlefonts_' . md5( wp_json_encode( $args ) );
		$cache      = get_site_transient( $cache_name );
		if ( $cache ) {
			return $cache;
		}

		$args['sort'] = isset( $args['sort'] ) ? $args['sort'] : 'alpha';

		$fonts         = $this->get_array();
		$ordered_fonts = $fonts['order'][ $args['sort'] ];
		if ( isset( $args['count'] ) ) {
			set_site_transient( $cache_name, $ordered_fonts, HOUR_IN_SECONDS );
			$ordered_fonts = array_slice( $ordered_fonts, 0, $args['count'] );
			return $ordered_fonts;
		}
		set_site_transient( $cache_name, $ordered_fonts, HOUR_IN_SECONDS );
		return $ordered_fonts;
	}
public function get_google_fonts_by_args ( $ args = [ ] ) { $ cache_name = 'kirki_googlefonts_' . md5 ( wp_json_encode ( $ args ) ) ; $ cache = get_site_transient ( $ cache_name ) ; if ( $ cache ) { return $ cache ; } $ args [ 'sort' ] = isset ( $ args [ 'sort' ] ) ? $ args [ 'sort' ] : 'alpha' ; $ fonts = $ this -> get_array ( ) ; $ ordered_fonts = $ fonts [ 'order' ] [ $ args [ 'sort' ] ] ; if ( isset ( $ args [ 'count' ] ) ) { set_site_transient ( $ cache_name , $ ordered_fonts , HOUR_IN_SECONDS ) ; $ ordered_fonts = array_slice ( $ ordered_fonts , 0 , $ args [ 'count' ] ) ; return $ ordered_fonts ; } set_site_transient ( $ cache_name , $ ordered_fonts , HOUR_IN_SECONDS ) ; return $ ordered_fonts ; }
Returns an array of google-fonts matching our arguments.

@access public
@since 0.1
@param array $args The arguments.
@return array
Returns an array of google - fonts matching our arguments .