Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.19 - Preload Fonts - Filter to add extensions #7284

Open
piotrbak opened this issue Feb 6, 2025 · 1 comment
Open

3.19 - Preload Fonts - Filter to add extensions #7284

piotrbak opened this issue Feb 6, 2025 · 1 comment
Assignees
Labels
effort: [S] 1-2 days of estimated development time
Milestone

Comments

@piotrbak
Copy link
Contributor

piotrbak commented Feb 6, 2025

User Story

As an admin, I want to apply preload fonts to other font file type using filter

Acceptance Criteria

  • Fonts are added using filter with font extension
  • Filter is guarded against unexpected values
@piotrbak piotrbak added this to the 3.19-alpha milestone Feb 6, 2025
@Miraeld Miraeld self-assigned this Feb 17, 2025
@Miraeld
Copy link
Contributor

Miraeld commented Feb 17, 2025

Scope a solution

⚠ This grooming is based on #7302

In

public function add_custom_data( array $data ): array {

We can add the following:

		$processed_extensions = [
			'woff2', 
			'woff',
			'ttf',
		];
		
		/**
		 * Filters the list of processed font extensions.
		 *
		 * @param array $processed_extensions Array of processed font extensions.
		 */
		wpm_apply_filters_typed( 'array', 'rocket_preload_fonts_processed_extensions', $processed_extensions );

		$data[ 'processed_extensions' ] = $processed_extensions;

So it will be given to rocket_beacon_data JS variable so it could be picked up by the beacon script.

@Khadreal Khadreal added the effort: [S] 1-2 days of estimated development time label Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: [S] 1-2 days of estimated development time
Projects
None yet
Development

No branches or pull requests

3 participants