Skip to content
  • Log In
  • Register
WordPress.org
  • News
  • Download & Extend
    • Get WordPress
    • Themes
    • Patterns
    • Plugins
    • Mobile
    • Hosting
    • Openverse ↗︎
  • Learn
    • Learn WordPress
    • Documentation
    • Forums
    • Developers
    • WordPress.tv ↗︎
  • Community
    • Make WordPress
    • Photo Directory
    • Five for the Future
    • WordCamp ↗︎
    • Meetups ↗︎
    • Job Board ↗︎
  • About
    • About WordPress
    • Showcase
    • Enterprise
    • Gutenberg ↗︎
    • WordPress Swag Store ↗︎
  • Get WordPress
Get WordPress

Developer Resources

Browse: Home / Reference / Classes / WP_Metadata_Lazyloader / WP_Metadata_Lazyloader::lazyload_comment_meta()

WP_Metadata_Lazyloader::lazyload_comment_meta( mixed $check ): mixed

Lazy-loads comment meta for queued comments.

Contents

  • Description
  • Parameters
  • Return
  • Source
  • Related
    • Uses
  • Changelog
  • User Contributed Notes

Description

This method is public so that it can be used as a filter callback. As a rule, there is no need to invoke it directly, from either inside or outside the WP_Query object.


Top ↑

Parameters

$check mixed Required
The $check param passed from the 'get_comment_metadata' hook.

Top ↑

Return

mixed The original value of $check, so as not to short-circuit get_comment_metadata().


Top ↑

Source

File: wp-includes/class-wp-metadata-lazyloader.php. View all references

public function lazyload_comment_meta( $check ) {
	if ( ! empty( $this->pending_objects['comment'] ) ) {
		update_meta_cache( 'comment', array_keys( $this->pending_objects['comment'] ) );

		// No need to run again for this set of comments.
		$this->reset_queue( 'comment' );
	}

	return $check;
}

View on Trac View on GitHub


Top ↑

Related

Top ↑

Uses

Uses
Uses Description
WP_Metadata_Lazyloader::reset_queue() wp-includes/class-wp-metadata-lazyloader.php

Resets lazy-load queue for a given object type.

update_meta_cache() wp-includes/meta.php

Updates the metadata cache for the specified objects.


Top ↑

Changelog

Changelog
Version Description
4.5.0 Introduced.

Top ↑

User Contributed Notes

You must log in before being able to contribute a note or feedback.

  • About
  • News
  • Hosting
  • Donate
  • Swag
  • Documentation
  • Developers
  • Get Involved
  • Learn
  • Showcase
  • Plugins
  • Themes
  • Patterns
  • WordCamp
  • WordPress.TV
  • BuddyPress
  • bbPress
  • WordPress.com
  • Matt
  • Privacy
  • Public Code
WordPress.org
WordPress.org
  • Visit our Facebook page
  • Visit our Twitter account
  • Visit our Instagram account
  • Visit our LinkedIn account
Code is Poetry

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.