wp_metadata_lazyloader() WordPress Function

The wp_metadata_lazyloader function is a utility function used to lazy load metadata for a given object type. It is useful for when you need to load metadata for objects but do not want to do so until they are actually needed. This function can be used with any object type that has metadata associated with it.

wp_metadata_lazyloader() #

Retrieves the queue for lazy-loading metadata.


Return

(WP_Metadata_Lazyloader) Metadata lazyloader queue.


Top ↑

Source

File: wp-includes/meta.php

function wp_metadata_lazyloader() {
	static $wp_metadata_lazyloader;

	if ( null === $wp_metadata_lazyloader ) {
		$wp_metadata_lazyloader = new WP_Metadata_Lazyloader();
	}

	return $wp_metadata_lazyloader;
}


Top ↑

Changelog

Changelog
VersionDescription
4.5.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.