WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Weird condition ( if ( ! WP_POST_REVISIONS ) line 5016) in post.php (5 posts)

  1. szaqal21
    Member
    Posted 2 years ago #

    What does this condition:

    if ( ! WP_POST_REVISIONS )
    		return array();

    do at line 5016 in wp-includes\post.php?

    When WP_POST_REVISIONS is set to 0 autosave revision is not displayed in post/page revisions list in admin panel?

  2. When post revisions are set to 0 there are no revisions saved. So ... yeah, the display is gone.

  3. szaqal21
    Member
    Posted 2 years ago #

    Not exactly, when revisions are set to 0, autosave revision is being saved. But this condition:

    if ( ! WP_POST_REVISIONS )
    		return array();

    doesn't allow it to be displayed in the Revisions panel. So you can't restore to autosave revision in the admin panel because it isn't visible. So what's the point of this condition?

    For me it doesn't do the right job.

  4. Autosave != revision save :)

  5. szaqal21
    Member
    Posted 2 years ago #

    ok, I get the point now.

    Thanks for reply

Topic Closed

This topic has been closed to new replies.

About this Topic