I would like to apologise to all of you who came here looking for documentation, plugins, or just a read. It seems that I screwed up when trying to add, what I call, “quick admin links” to posts. It’s just some links that allow you to delete/edit comments and/or posts. Unfortunately I did the following with the “the_content” filter:
if (!current_user_can('edit_post', $post->ID)) { return; }
Of course, that meant that all of you who were not logged in to my site, could not see any post nor comment contents, while I could see them just fine. And this brings up a good point. When using filters, remember to return the original content passed to your function, or you’ll end up like me, contentless.
Here’s what I should have done and now have done:
if (!current_user_can('edit_post', $post->ID)) { return $content; }
Again, sorry to all who came looking for content.
Comments
The opinions expressed in comments are entirely the responsibility of the various contributors. While I will do everything within reason to ensure that they are not defamatory, I accept no liability for them or the content of links included in them.
Will (#2573)
Hey,
I have done that a few times. lol Even worse, I deleted all members once, simply because I screwed up the where clause of an sql statement. he-he Thankfully I love backups. :mrgreen:
Take Care,
Will
James (#2574)
You need an RSS feed! And if you have one, I need it more visible!
Great work m8, helping me through college.
WebtrafficJunkie (#2577)
Thanks for posting the mistake that you made, now I will have a better chance of not doing that myself. Thanks for the information!!