WP_Metadata_Lazyloader::reset_queue( string $object_type ): void|WP_Error

In this article

Resets lazy-load queue for a given object type.

Parameters

$object_typestringrequired
Object type. Accepts 'comment' or 'term'.

Return

void|WP_Error WP_Error on failure.

Source

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'] );
}

Changelog

VersionDescription
4.5.0Introduced.

User Contributed Notes

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