WordPress.org

Ready to get started?Download WordPress

Forums

BUG: Private post not showing up when logged in (11 posts)

  1. Anonymous
    Unregistered
    Posted 10 years ago #

    This has been posted before but misunderstood. My private posts do not show on the index.php even though I am logged in. There is code for this in wp-blog-header.php

    // Get private posts
    if (isset($user_ID) && ('' != intval($user_ID)))
    $where .= " OR post_author = $user_ID AND post_status != 'draft')";

    The problem though, is that $user_ID is not set at this point of execution for some reason. Yet $user_ID is set by the end of index.php. I don't know where or how. I tested this by doing an echo right before the above code, another at the top of index.php and another at the end of index.php. Only the last one output my userID.

  2. RAGE4204
    Member
    Posted 10 years ago #

    The above was posted by me. This was tested on the 1.0.2 and the latest nightly 20050509.

  3. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    Private posts are not ever supposed to show up in index.php, whether you are logged in or not.

  4. carthik
    Member
    Posted 10 years ago #

    get_currentuserinfo(); is the function that seems to set $user_ID, and the value for that is set when the condition as to whether or not the "edit this" link has to be displayed.
    Try putting get_currentuserinfo(); just above the line that decides whether or not to show private posts. Might work!
    general note: get_currentuserinfo() is in wp-admin/functions.php

  5. rpeeck
    Member
    Posted 10 years ago #

    ^^ worked.

  6. RAGE4204
    Member
    Posted 10 years ago #

    Thanks 2fargon and allusion. The way the code is written, it looks like a bug. If current page was tested for edit.php right before testing for userID then it would look intended. I like my private posts on the front page. Maybe there should be an option for it? Thanks for a great app btw =)

  7. carthik
    Member
    Posted 10 years ago #

    allusion tells me that private posts should not show on the blog, and that there are issues related to this. So please be advised that it might not be the best thing to do.

  8. rpeeck
    Member
    Posted 10 years ago #

    what sort of issues? I'm curious now =)

  9. carthik
    Member
    Posted 10 years ago #

    hey rpeeck, that was me, your curiosity ticked mine off! Sorry if that bothered you, I really didn't mean to do any harm :)

  10. rpeeck
    Member
    Posted 10 years ago #

    ^^ heheh, its cool. i was just wondering if it worked though. cuz i tried the same thing myself. :-P

  11. carthik
    Member
    Posted 10 years ago #

    No, it did not.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.