PluginProbe
EasyFonts – Host Google Fonts Locally, Fast & Auto-Optimize, GDPR Compliant / 2.0.4
EasyFonts – Host Google Fonts Locally, Fast & Auto-Optimize, GDPR Compliant v2.0.4
2.0.4 2.0.3 2.0.2 2.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2 1.3 2.0.0
← All changes | src/Detect/Pipeline.php +9 -3 2.0.0 → 2.0.4 View file →
@@ -21,13 +21,15 @@
21 21 /**
22 22 * Process a document: detect every web-font source, host them locally as a
23 23 * single consolidated stylesheet, and return the rewritten HTML.
24 24 *
25 - * @param string $html Full HTML.
26 - * @param bool $force Force a full pass (probe mode).
25 + * @param string $html Full HTML.
26 + * @param bool $force Force a full pass (probe mode).
27 + * @param array<string,bool> $scope_out Confirmed loaded-but-unused families on this route (lowercased => true).
28 + * @param bool $measured Route has beacon data (enables scoping).
27 29 * @return string
28 30 */
29 - public function process( string $html, bool $force = false ): string {
31 + public function process( string $html, bool $force = false, array $scope_out = array(), bool $measured = false ): string {
30 32 /**
31 33 * Filter the consolidator instance, allowing advanced replacement.
32 34 *
33 35 * @param Consolidator $consolidator
@@ -32,8 +34,12 @@
32 34 *
33 35 * @param Consolidator $consolidator
34 36 */
35 37 $consolidator = apply_filters( 'easyfonts_consolidator', new Consolidator() );
38 +
39 + if ( method_exists( $consolidator, 'set_page_scope' ) ) {
40 + $consolidator->set_page_scope( $scope_out, $measured );
41 + }
36 42
37 43 return $consolidator->run( $html, $force );
38 44 }
39 45