0

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.

enter image description here

2
  • esc_url() is correct. Did it not work? Commented May 17, 2018 at 9:19
  • @Jacob Peattie yeah it is working fine. thanks, I just want to know it is correct or not according to the WordPress standards. Commented May 17, 2018 at 9:26

1 Answer 1

1

Yes it is correct. Escaping should be done based on context, and since wp_nonce_url() is used in an hrefas proper url, you should use esc_url.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.