'https://fonts.gstatic.com', 'crossorigin', ); } return $urls; } /** * Get fonts URL. */ public static function fonts_url() { $fonts_url = ''; $font_families = array(); $query_params = array(); /* translators: If there are characters in your language that are not supported by Open Sans, translate this to 'off'. Do not translate into your own language. */ $open_sans = _x( 'on', 'Open Sans font: on or off', 'pressbook-dark' ); if ( 'off' !== $open_sans ) { array_push( $font_families, 'Open+Sans:ital,wght@0,400;0,600;1,400;1,600' ); } /* translators: If there are characters in your language that are not supported by Playfair Display, translate this to 'off'. Do not translate into your own language. */ $playfair_display = _x( 'on', 'Playfair Display font: on or off', 'pressbook-dark' ); if ( 'off' !== $playfair_display ) { array_push( $font_families, 'Playfair+Display:ital,wght@0,400;0,600;1,400;1,600' ); } if ( count( $font_families ) > 0 ) { foreach ( $font_families as $font_family ) { array_push( $query_params, ( 'family=' . $font_family ) ); } array_push( $query_params, 'display=swap' ); $fonts_url = ( 'https://fonts.googleapis.com/css2?' . implode( '&', $query_params ) ); } $fonts_url = apply_filters( 'pressbook_dark_fonts_url', $fonts_url ); return esc_url_raw( $fonts_url ); } /** * Remove parent theme inline style. */ public function print_styles() { if ( wp_style_is( 'pressbook-style', 'enqueued' ) ) { wp_style_add_data( 'pressbook-style', 'after', '' ); } } /** * Remove theme inline style. */ public function remove_dynamic_styles() { if ( wp_style_is( 'pressbook-dark-style', 'enqueued' ) ) { wp_style_add_data( 'pressbook-dark-style', 'after', '' ); } } /** * Set inline style handle id. * * @param string $handle_id Handle ID. * @return string */ public function inline_style_handle_id( $handle_id ) { return 'pressbook-dark-style-inline-css'; } }