Forums

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

  1. szaqal21
    Member
    Posted 5 months 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. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 5 months ago #

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

  3. szaqal21
    Member
    Posted 5 months 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. Ipstenu
    Half-Elf Support Rogue & Mod
    Posted 5 months ago #

    Autosave != revision save :)

  5. szaqal21
    Member
    Posted 5 months ago #

    ok, I get the point now.

    Thanks for reply

Reply

You must log in to post.

About this Topic