• About WordPress
    • About WordPress
    • WordPress.org
    • Documentation
    • Support
    • Feedback
  • Log In
  • Register
WordPress.org
WordPress.org
  • Plugins
  • Themes
  • Patterns
  • Learn
  • Support
    • Documentation
    • Forums
  • News
  • About
  • Get Involved
    • Five for the Future
  • Showcase
  • Mobile
  • Hosting
  • Openverse
  • Get WordPress
Get WordPress

Code Reference

Skip to content
Filter by type:
Search
Browse: Home / Reference / Classes / WP_Metadata_Lazyloader / WP_Metadata_Lazyloader::lazyload_comment_meta()

WP_Metadata_Lazyloader::lazyload_comment_meta( mixed $check )

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

	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;
	}

Expand full source code Collapse full source code View on Trac View on GitHub


Top ↑

Related

Top ↑

Uses

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

Resets lazy-load queue for a given object type.

wp-includes/meta.php: update_meta_cache()

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
  • Support
  • 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
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.