36 articles and counting
      

Wordpress – Your Attempt to Edit this Post: has Failed

This was one annoying little bug I found recently running version 2.8.4 of wordpress, and after a bit of Googling it seems it has been around for a while. Ive seen quite a few explanations as to the cause ie. plugins etc and the only ‘fix’ Ive seen so far is to manually disable autosave.

I didn’t want to disable autosave since the lack of anything descriptive in the Codex led me to believe that this isnt a bug in the wordpress core code. After a bit of messing about I fixed my own cause of the problem and its both a bit weird and a very easy fix at the same time.

My problems began after adding some code to functions.php so I removed the code and low and behold the issue was gone. I initially thought my code had a bug (its quite normal :) but after spending a few hours going through it I couldn’t figure what was wrong. Turns out it wasn’t the code that was the issue but newlines after my last bit of code in functions.php.

This fails for me in 2.8.4:

< ?php
if ( function_exists('register_sidebars') )
    register_sidebars(2);
?>

 .

And this works (notice no newlines after close of block):

< ?php
if ( function_exists('register_sidebars') )
    register_sidebars(2);
?>

Thought I would share this since I know it won’t fix it for everyone, but its worth a try if you are seeing this error after editing your functions.php.


Comment / Leave a Review

  Name (required)
  Mail (will not be published) (required)

Spam protection by WP Captcha-Free