Matt Read, The Weblog

Abusing monkeys since 2003

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. hahahah


Comments

  1. Comment by Will

    2006-08-14 01:51:59

    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

  2. Comment by James

    2006-08-16 08:56:42

    You need an RSS feed! And if you have one, I need it more visible!

    Great work m8, helping me through college.

  3. Comment by WebtrafficJunkie

    2006-08-17 19:42:56

    Thanks for posting the mistake that you made, now I will have a better chance of not doing that myself. Thanks for the information!!

  4. Comment by Bex

    2006-09-04 23:23:57

    ;-)


Leave a Comment

Your Information (required)