WordPress.org

  • Showcase
  • Themes
  • Plugins
  • Mobile
  • Support
    • Documentation
    • Forums
  • Get Involved
  • About
  • Blog
  • Hosting
  • 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
    • Changelog
  • Related
    • Uses
  • User Contributed Notes

Description #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.


Parameters #Parameters

$check

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


Top ↑

Return #Return

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


Top ↑

Source #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


Top ↑

Changelog #Changelog

Changelog
Version Description
4.5.0 Introduced.

Top ↑

Related #Related

Top ↑

Uses #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()

Update the metadata cache for the specified objects.


Top ↑

User Contributed Notes #User Contributed Notes

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

  • About
  • Blog
  • Hosting
  • Donate
  • Support
  • Developers
  • Get Involved
  • Showcase
  • Plugins
  • Themes
  • WordCamp
  • WordPress.TV
  • BuddyPress
  • bbPress
  • WordPress.com
  • Matt
  • Privacy
  • Public Code
  • @WordPress
  • WordPress

Code is Poetry.

Skip to toolbar
  • About WordPress
    • About WordPress
    • WordPress.org
    • Documentation
    • Support Forums
    • Feedback
  • Log In
  • Register