Share/Bookmark

How to Fix the Democracy Plugin n Problem

I noticed during a recent WordPress upgrade, the Democracy Plugin started adding an extra "n" each time you saved the post:

Democracy Plugin n Problem

Here's how to fix the problem:

(1) With a text editor, open "democracy.php" – it's located in the democracy subfolder in the plugin folder.

(2) Locate the line below (around line number 331):

return preg_replace('/{democracy[\w\W\s^}]*?}/', '\n<div>\\0</div>', $content);

(3) Change the last set of single quotes into double quotes:

return preg_replace('/{democracy[\w\W\s^}]*?}/', "\n<div>\\0</div>", $content);

That's it. That should take care of the Democracy Plugin's extra n problem.

This entry was posted in How-to. Bookmark the permalink.

3 Responses to How to Fix the Democracy Plugin n Problem

  1. Chris says:

    I have been trying to fix this all day. my code doesnt have that return preg_replace line in it anywhere ??? weird!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

iZachy Newsletter

Don't have time to visit iZachy everyday? Then sign up for my free newsletter. I'll send you an email when I have something to share with you. Your email address will be kept confidential and I will not share, sell, or rent it to anyone. You can unsubscribe at any time by clicking a link in the email.

Enter your email address to sign up for my newsletter:
  

Or you can also sign up for our blog feed.