WordPress adds slashes before quotes even if we do not want to use magic quotes.
To solve this problem, you can use either of the following two functions on the values returned from POST requests-
- wp_unslash
- stripslashes_deep
References:
- https://developer.wordpress.org/reference/functions/wp_unslash/
- https://developer.wordpress.org/reference/functions/stripslashes_deep/
- https://core.trac.wordpress.org/ticket/18322
Category: WordPress