Title: [Plugin: PHP Code Widget] Escape Slashes Not Kept
Last modified: August 19, 2016

---

# [Plugin: PHP Code Widget] Escape Slashes Not Kept

 *  [Seth](https://wordpress.org/support/users/swilschutz/)
 * (@swilschutz)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-php-code-widget-escape-slashes-not-kept/)
 * I’m trying to use this plugin but my escape slashes are removed when I save the
   widget code.
 * This
 *     ```
       function nl2br2($string) {
       $string = str_replace(array("\r\n", "\r", "\n"), "<br />", $string);
       return $string;
       }
       ```
   
 * Turns to
 *     ```
       function nl2br2($string) {
       $string = str_replace(array("rn", "r", "n"), "<br />", $string);
       return $string;
       }
       ```
   
 * Any thoughts?
 * [http://wordpress.org/extend/plugins/php-code-widget/](http://wordpress.org/extend/plugins/php-code-widget/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-php-code-widget-escape-slashes-not-kept/#post-1992666)
 * Does it still happen if you turn off the automatic paragraph stuff?
 * Looking through the code, it runs the text through wpautop() if you have that
   enabled.
 * It also runs it through wp_filter_post_kses() if you don’t have the unfiltered_html
   capability.
 *  Thread Starter [Seth](https://wordpress.org/support/users/swilschutz/)
 * (@swilschutz)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-php-code-widget-escape-slashes-not-kept/#post-1992875)
 * Yes, it still happens with automatic paragraph checked and unchecked. I’m only
   a novice at WP, but there must have been a change to the WP back-end in one of
   the updates. It didn’t happen before I upgraded to WP 3.1 — I had escaped PHP
   scripts and they were working just fine. Then I went to make a change and when
   I saved the change at the widget, I noticed the problem.
 * I’m not familiar with wpautop(), but will look into its settings.
 * – Seth

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: PHP Code Widget] Escape Slashes Not Kept’ is closed to new replies.

 * ![](https://ps.w.org/php-code-widget/assets/icon.svg?rev=992095)
 * [PHP Code Widget](https://wordpress.org/plugins/php-code-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-code-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-code-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/php-code-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-code-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-code-widget/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Seth](https://wordpress.org/support/users/swilschutz/)
 * Last activity: [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-php-code-widget-escape-slashes-not-kept/#post-1992875)
 * Status: not resolved