Matt Read, The Weblog
Main Navigation
Where Has All The Content Gone?
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.
Comment by Will
2006-08-13T21:51:59-04:00 EDT
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.
Take Care,
Will
Comment by James
2006-08-16T04:56:42-04:00 EDT
You need an RSS feed! And if you have one, I need it more visible!
Great work m8, helping me through college.
Comment by WebtrafficJunkie
2006-08-17T15:42:56-04:00 EDT
Thanks for posting the mistake that you made, now I will have a better chance of not doing that myself. Thanks for the information!!
Comment by Bex
2006-09-04T19:23:57-04:00 EDT
;-)