New answers tagged

0 votes

#038 & wordpress Help

esc_url() has a $_context argument which defaults to 'display'. It will replace & with & unless you change context to something else, e.g. sanitize_url uses 'db'. (Why it uses & ...
Rup's user avatar
  • 4,247
0 votes

How to change css poperty through webhook in wordpress

you are trying to return data from the PHP function showTheButton(). You are directly echoing js code inside the function, which will not be properly handled when returning data from the function. ...
vijay pancholi's user avatar
0 votes

How to allow single quote with esc_html__() without sprintf()

The source code for esc_html() uses $safe_text = _wp_specialchars($safe_text, ENT_QUOTES); to handle quotes. The description for the second parameter of the _wp_specialchars() function states: ...
AuRise's user avatar
  • 449
0 votes

window.location.href doesnt' work to redirect page

In your code missing searchButton and filterSelect variables and also JS code executes after the DOM has fully loaded try the below the script. <script> document.addEventListener('...
vijay pancholi's user avatar
1 vote

window.location.href doesnt' work to redirect page

Your code only works on two conditions. Does not work any time neither of those two conditions are active. But the proper way to redirect in WP is with the wp_redirect() function: wp_redirect('https:/...
Rick Hellewell's user avatar
0 votes

Why does my JavaScript work in the browser console but does not work in my shortcode?

Solved by wrapping everything in document.addEventListener("DOMContentLoaded", function() {} Realized it was trying to fire the script off document.addEventListener("DOMContentLoaded&...
rnkwill's user avatar

Top 50 recent answers are included