[wp-trac] [WordPress Trac] #52842: No way to adjust attributes in wp_resource_hints()
WordPress Trac
noreply at wordpress.org
Thu Mar 18 04:02:03 UTC 2021
#52842: No way to adjust attributes in wp_resource_hints()
--------------------------+-----------------------------
Reporter: vanyukov | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: minor | Keywords: needs-patch
Focuses: |
--------------------------+-----------------------------
Not sure if this is a bug or an improvement.
In `wp_resource_hints()` we're checking for valid attributes:
{{{#!php
<?php
if ( ! is_scalar( $value )
|| ( ! in_array( $attr, array( 'as', 'crossorigin', 'href', 'pr',
'rel', 'type' ), true ) && ! is_numeric( $attr ) )
) {
continue;
}
}}}
but there's no way to define those attributes, because the only ones that
are being set are `rel` and `href`:
{{{#!php
<?php
$atts['rel'] = $relation_type;
$atts['href'] = $url;
}}}
Can we add a filter to allow modifying all these attributes?
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52842>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list