Assets Filter
This page documents the filter for controlling CSS asset inlining.
| Filter | Description |
|---|---|
unblock/assets/css_inline_size | CSS inline size threshold |
assets/css_inline_size
Control the CSS file size threshold for inlining. Files smaller than this threshold are inlined in the HTML instead of linked externally.
| Parameter | Type | Description |
|---|---|---|
$threshold | int | Size in bytes |
Default: 51200 (50 KB)
Example: Increase Threshold
add_filter( 'unblock/assets/css_inline_size', function ( $threshold ) {
return 100 * 1024; // 100 KB
} );
Example: Disable Inlining
add_filter( 'unblock/assets/css_inline_size', function ( $threshold ) {
// Return 0 to always use external files.
return 0;
} );
Example: Always Inline
add_filter( 'unblock/assets/css_inline_size', function ( $threshold ) {
// Return a large value to always inline.
return PHP_INT_MAX;
} );
Next steps
- System filters — plugin options and filesystem control
- Security filters — HTML and SVG sanitization