I'm working with the MegaMenu here echo wp_nonce_url()
is showing an error All output should run through an escaping function
according to wpcs. I gave echo esc_url( wp_nonce_url())
Is it correct? Point me where am I going wrong.
1 Answer
Yes it is correct. Escaping should be done based on context, and since wp_nonce_url()
is used in an href
as proper url, you should use esc_url
.
esc_url()
is correct. Did it not work?