_wp_keep_alive_customize_changeset_dependent_auto_drafts


_wp_keep_alive_customize_changeset_dependent_auto_drafts ( $new_status, $old_status, $post )

Access:
  • private
Parameters:
  • (string) $new_status Transition to this post status.
  • (string) $old_status Previous post status.
  • (WP_Post) $post Post data.
Links:
See:
Defined at:

Description

Make sure that auto-draft posts get their post_date bumped or status changed to draft to prevent premature garbage-collection.

When a changeset is updated but remains an auto-draft, ensure the post_date for the auto-draft posts remains the same so that it will be garbage-collected at the same time by wp_delete_auto_drafts(). Otherwise, if the changeset is updated to be a draft then update the posts to have a far-future post_date so that they will never be garbage collected unless the changeset post itself is deleted.

When a changeset is updated to be a persistent draft or to be scheduled for publishing, then transition any dependent auto-drafts to a draft status so that they likewise will not be garbage-collected but also so that they can be edited in the admin before publishing since there is not yet a post/page editing flow in the Customizer. See #39752.

Related Functions

_wp_delete_customize_changeset_dependent_auto_drafts, _wp_customize_changeset_filter_insert_post_data, _wp_customize_publish_changeset, customize_themes_print_templates

Top Google Results

User discussions

wpseek mobile