WP_Customize_Nav_Menus::make_auto_draft_status_previewable() WordPress Method

The WP_Customize_Nav_Menus::make_auto_draft_status_previewable() method is used to make auto-draft status posts previewable in the Customizer. This is useful for making sure that changes made to nav menus in the Customizer are not lost when the Customizer is closed.

WP_Customize_Nav_Menus::make_auto_draft_status_previewable() #

Makes the auto-draft status protected so that it can be queried.


Source

File: wp-includes/class-wp-customize-nav-menus.php

	public function make_auto_draft_status_previewable() {
		global $wp_post_statuses;
		$wp_post_statuses['auto-draft']->protected = true;
	}

Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.