• 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::reset_queue()

WP_Metadata_Lazyloader::reset_queue( string $object_type )

Resets lazy-load queue for a given object type.

Contents

  • Parameters
  • Return
  • Source
  • Related
    • Uses
    • Used By
  • Changelog
  • User Contributed Notes

Parameters

$object_type

(string) (Required) Object type. Accepts 'comment' or 'term'.


Top ↑

Return

(void|WP_Error) WP_Error on failure.


Top ↑

Source

File: wp-includes/class-wp-metadata-lazyloader.php

	public function reset_queue( $object_type ) {
		if ( ! isset( $this->settings[ $object_type ] ) ) {
			return new WP_Error( 'invalid_object_type', __( 'Invalid object type.' ) );
		}

		$type_settings = $this->settings[ $object_type ];

		$this->pending_objects[ $object_type ] = array();
		remove_filter( $type_settings['filter'], $type_settings['callback'] );
	}

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


Top ↑

Related

Top ↑

Uses

Uses
Uses Description
wp-includes/l10n.php: __()

Retrieve the translation of $text.

wp-includes/plugin.php: remove_filter()

Removes a callback function from a filter hook.

wp-includes/class-wp-error.php: WP_Error::__construct()

Initializes the error.

Top ↑

Used By

Used By
Used By Description
wp-includes/class-wp-metadata-lazyloader.php: WP_Metadata_Lazyloader::lazyload_term_meta()

Lazy-loads term meta for queued terms.

wp-includes/class-wp-metadata-lazyloader.php: WP_Metadata_Lazyloader::lazyload_comment_meta()

Lazy-loads comment meta for queued comments.


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.