1
vote
Filter nav menu items HTML tags and wrap inner text with span
Just use link_before in your wp_nav_menu $args and add opening/closing span tags:
$args = [
'link_before' => '<span>',
/* Add closing </span> to link_after */
'link_after' =&...
1
vote
How to add nonce tag to inline script for CSP
You can use the script_loader_tag filter:
function wpse_406351_script_tag_nonce( $tag, $handle ) {
if ( $handle === 'id_of_script' /* handle used in wp_enqueue_script/wp_register_script */ ) {
...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
filters × 2902hooks × 466
functions × 304
actions × 304
plugins × 226
php × 210
custom-post-types × 197
plugin-development × 183
wp-query × 138
posts × 134
the-content × 126
categories × 117
woocommerce-offtopic × 115
customization × 99
shortcode × 95
menus × 90
images × 89
search × 77
theme-development × 76
custom-taxonomy × 73
custom-field × 70
admin × 61
wp-admin × 59
loop × 58
ajax × 58