Support » Requests and Feedback » Weird condition ( if ( ! WP_POST_REVISIONS ) line 5016) in post.php

  • Resolved szaqal21

    (@szaqal21)


    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?

Viewing 4 replies - 1 through 4 (of 4 total)
  • When post revisions are set to 0 there are no revisions saved. So … yeah, the display is gone.

    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.

    Autosave != revision save 🙂

    ok, I get the point now.

    Thanks for reply

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Weird condition ( if ( ! WP_POST_REVISIONS ) line 5016) in post.php’ is closed to new replies.