wp_revisions_to_keep example

return;
            }
        }
    }

    $return = _wp_put_post_revision( $post );

    /* * If a limit for the number of revisions to keep has been set, * delete the oldest ones. */
    $revisions_to_keep = wp_revisions_to_keep( $post );

    if ( $revisions_to_keep < 0 ) {
        return $return;
    }

    $revisions = wp_get_post_revisions( $post_id, array( 'order' => 'ASC' ) );

    /** * Filters the revisions to be considered for deletion. * * @since 6.2.0 * * @param WP_Post[] $revisions Array of revisions, or an empty array if none. * @param int $post_id The ID of the post to save as a revision. */
Home | Imprint | This part of the site doesn't use cookies.