New answers tagged filters
0
votes
How to allow Unfiltered HTML in a wordpress multisite install
I found this code to work for me
function multisite_restore_unfiltered_html( $caps, $cap, $user_id, ...$args ) {
if ( 'unfiltered_html' === $cap && (user_can( $user_id, 'editor' ) || ...
0
votes
Filter nav menu items HTML tags and wrap inner text with span
Here is my solution with assistance from TheDeadMedic.
I added the <svg> code to the replacement value in the preg_replace function, then added the opening and closing <span> tags to the ...
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 */ ) {
...
0
votes
Accepted
How do I add <div> tags to entire comments, not just their text
Currently your comment markup looks similar to the following:
<li class="comment byuser comment-author-rcotwunite odd alt thread-odd thread-alt depth-1" id="comment-7902">
&...
1
vote
Accepted
How to replace username with email address in users table
It seems that the username column content is hardcoded in single_row() of WP_Users_List_Table and there isn't a filter you can use to change it.
A hacky way is to enqueue some javascript on the users ...
0
votes
How to replace username with email address in users table
function wpse406344_replace_usernames() {
//Get all the users
$users = get_users();
//Loop through them and update user_login table
foreach( $users as $user ) {
...
Top 50 recent answers are included
Related Tags
filters × 2900hooks × 466
functions × 304
actions × 304
plugins × 226
php × 210
custom-post-types × 196
plugin-development × 183
wp-query × 138
posts × 133
the-content × 126
categories × 117
woocommerce-offtopic × 115
customization × 99
shortcode × 94
menus × 90
images × 89
search × 77
theme-development × 76
custom-taxonomy × 73
custom-field × 69
admin × 61
wp-admin × 59
loop × 58
ajax × 58