Matt Read, The Weblog

Abusing monkeys since 2003

Main Navigation


Where Has All The Content Gone?

Saturday, August 12th 2006

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

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.

  1. 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. :mrgreen:

    Take Care,

    Will

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

  3. 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!!

  4. Comment by Bex

    2006-09-04T19:23:57-04:00 EDT

    ;-)


Leave a Comment

Before leaving a comment, please ensure you have read and understand my comments policy and my privacy policy. Any comment that does not abide by the comment policy will be deleted immediately.

Your Information (required)