Mini Shell

Direktori : /www/wwwroot/itapgo.com/wp-includes/
Upload File :
Current File : /www/wwwroot/itapgo.com/wp-includes/class-wp-metadata-lazyloader.php

<?php
/**
 * Meta API: WP_Metadata_Lazyloader class
 *
 * @package WordPress
 * @subpackage Meta
 * @since 4.5.0
 */

/**
 * Core class used for lazy-loading object metadata.
 *
 * When loading many objects of a given type, such as posts in a WP_Query loop, it often makes
 * sense to prime various metadata caches at the beginning of the loop. This means fetching all
 * relevant metadata with a single database query, a technique that has the potential to improve
 * performance dramatically in some cases.
 *
 * In cases where the given metadata may not even be used in the loop, we can improve performance
 * even more by only priming the metadata cache for affected items the first time a piece of metadata
 * is requested - ie, by lazy-loading it. So, for example, comment meta may not be loaded into the
 * cache in the comments section of a post until the first time get_comment_meta() is called in the
 * context of the comment loop.
 *
 * WP uses the WP_Metadata_Lazyloader class to queue objects for metadata cache priming. The class
 * then detects the relevant get_*_meta() function call, and queries the metadata of all queued objects.
 *
 * Do not access this class directly. Use the wp_metadata_lazyloader() function.
 *
 * @since 4.5.0
 */
#[AllowDynamicProperties]
class WP_Metadata_Lazyloader {
	/**
	 * Pending objects queue.
	 *
	 * @since 4.5.0
	 * @var array
	 */
	protected $pending_objects;

	/**
	 * Settings for supported object types.
	 *
	 * @since 4.5.0
	 * @var array
	 */
	protected $settings = array();

	/**
	 * Constructor.
	 *
	 * @since 4.5.0
	 */
	public function __construct() {
		$this->settings = array(
			'term'    => array(
				'filter'   => 'get_term_metadata',
				'callback' => array( $this, 'lazyload_meta_callback' ),
			),
			'comment' => array(
				'filter'   => 'get_comment_metadata',
				'callback' => array( $this, 'lazyload_meta_callback' ),
			),
			'blog'    => array(
				'filter'   => 'get_blog_metadata',
				'callback' => array( $this, 'lazyload_meta_callback' ),
			),
		);
	}

	/**
	 * Adds objects to the metadata lazy-load queue.
	 *
	 * @since 4.5.0
	 *
	 * @param string $object_type Type of object whose meta is to be lazy-loaded. Accepts 'term' or 'comment'.
	 * @param array  $object_ids  Array of object IDs.
	 * @return void|WP_Error WP_Error on failure.
	 */
	public function queue_objects( $object_type, $object_ids ) {
		if ( ! isset( $this->settings[ $object_type ] ) ) {
			return new WP_Error( 'invalid_object_type', __( 'Invalid object type.' ) );
		}

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

		if ( ! isset( $this->pending_objects[ $object_type ] ) ) {
			$this->pending_objects[ $object_type ] = array();
		}

		foreach ( $object_ids as $object_id ) {
			// Keyed by ID for faster lookup.
			if ( ! isset( $this->pending_objects[ $object_type ][ $object_id ] ) ) {
				$this->pending_objects[ $object_type ][ $object_id ] = 1;
			}
		}

		add_filter( $type_settings['filter'], $type_settings['callback'], 10, 5 );

		/**
		 * Fires after objects are added to the metadata lazy-load queue.
		 *
		 * @since 4.5.0
		 *
		 * @param array                  $object_ids  Array of object IDs.
		 * @param string                 $object_type Type of object being queued.
		 * @param WP_Metadata_Lazyloader $lazyloader  The lazy-loader object.
		 */
		do_action( 'metadata_lazyloader_queued_objects', $object_ids, $object_type, $this );
	}

	/**
	 * Resets lazy-load queue for a given object type.
	 *
	 * @since 4.5.0
	 *
	 * @param string $object_type Object type. Accepts 'comment' or 'term'.
	 * @return void|WP_Error WP_Error on failure.
	 */
	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'] );
	}

	/**
	 * Lazy-loads term meta for queued terms.
	 *
	 * 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.
	 *
	 * @since 4.5.0
	 * @deprecated 6.3.0 Use WP_Metadata_Lazyloader::lazyload_meta_callback() instead.
	 *
	 * @param mixed $check The `$check` param passed from the 'get_term_metadata' hook.
	 * @return mixed In order not to short-circuit `get_metadata()`. Generally, this is `null`, but it could be
	 *               another value if filtered by a plugin.
	 */
	public function lazyload_term_meta( $check ) {
		_deprecated_function( __METHOD__, '6.3.0', 'WP_Metadata_Lazyloader::lazyload_meta_callback' );
		return $this->lazyload_meta_callback( $check, 0, '', false, 'term' );
	}

	/**
	 * Lazy-loads comment meta for queued comments.
	 *
	 * 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.
	 *
	 * @since 4.5.0
	 * @deprecated 6.3.0 Use WP_Metadata_Lazyloader::lazyload_meta_callback() instead.
	 *
	 * @param mixed $check The `$check` param passed from the {@see 'get_comment_metadata'} hook.
	 * @return mixed The original value of `$check`, so as not to short-circuit `get_comment_metadata()`.
	 */
	public function lazyload_comment_meta( $check ) {
		_deprecated_function( __METHOD__, '6.3.0', 'WP_Metadata_Lazyloader::lazyload_meta_callback' );
		return $this->lazyload_meta_callback( $check, 0, '', false, 'comment' );
	}

	/**
	 * Lazy-loads meta for queued objects.
	 *
	 * 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.
	 *
	 * @since 6.3.0
	 *
	 * @param mixed  $check     The `$check` param passed from the 'get_*_metadata' hook.
	 * @param int    $object_id ID of the object metadata is for.
	 * @param string $meta_key  Unused.
	 * @param bool   $single    Unused.
	 * @param string $meta_type Type of object metadata is for. Accepts 'post', 'comment', 'term', 'user',
	 *                          or any other object type with an associated meta table.
	 * @return mixed In order not to short-circuit `get_metadata()`. Generally, this is `null`, but it could be
	 *               another value if filtered by a plugin.
	 */
	public function lazyload_meta_callback( $check, $object_id, $meta_key, $single, $meta_type ) {
		if ( empty( $this->pending_objects[ $meta_type ] ) ) {
			return $check;
		}

		$object_ids = array_keys( $this->pending_objects[ $meta_type ] );
		if ( $object_id && ! in_array( $object_id, $object_ids, true ) ) {
			$object_ids[] = $object_id;
		}

		update_meta_cache( $meta_type, $object_ids );

		// No need to run again for this set of objects.
		$this->reset_queue( $meta_type );

		return $check;
	}
}
福建点点够企业管理有限公司 | 中国银联条码前置平台全国拓展商

打造支付生态系统

打造由机构、商家、供应链、消费者多重角色的支付生态系统,支持机构实现管道财富自由!

专业的国际化内训扁平化的奖金制度

系统化、国际化的内训

专业的导师团、教练团为团队赋能,支持团队每个人拿到自己的家庭、事业、健康三大目标,同时有内训系统的晋升机制,全面实现每个合伙人“生命丰盛,生活富足”的人生愿景。

平台化支付管道收益

响应国家平台化经济体建设政策号召,深入运营中国银联条码支付综合前置平台的全国拓展,以及国有企业-现代金控的创鑫钱包业务全国合伙人招募,令每个参与者都能建立稳定、可持续的管道式收益事业。

未来前瞻

居于庞大的合伙人群体建设成熟,形成了海量的商户和交易数据,为点点够系统沉淀巨量大数据,数据资产运营以及以人为本的自主研发产品将逐步上线,旨在让每个点点够的数据节点都能发挥出应有的价值。

以人为本的培训生态

点点够引入了国际先进的企业管理课程,并对课程内容进行了行业订制化和国学本土化的转换,每个加入点点够的内勤或合伙人都将经历“体验式”全程培训,历经4个月。全面将每一个人打造成为在生活和工作方方面面都有影响力的人物。

为什么选择点点够?

在点点够,除了让你建立以国有企业为背景的产品平台管道式收益,还让你在不断学习和教练托起团队成员的同时,也不断让你越来越“值钱”。一群人,一起做一件有意义有价值的事情。建立正向的人生观、价值观、世界观。

2019年初,中国银联上线“条码前置平台-up.95516.com”,福建点点够企业管理有限公司与中国银联厦门分公司、新生支付有限公司签署三方协议,成为中国银联全国拓展机构。并开始向全国拓展子机构。

2022年4月点点够又与国通星驿签署全国拓展协议,补充了新生支付只能在福建、浙江、江苏、四川、海南五省拓展的不足。真正为全国全量拓展提供了更多可能性。

点点够团队志在2023年12月1日达到月交易过百亿!

值得投资的大数据价值

点点够将不断沉淀合伙人、商户、消费者交易数据,海量的数据将转化为更具时代意义的价值,我们将数据从现实交易数据转化为“实体+虚拟化”二维世界的数据,为用户提供现实和元宇宙双重服务。点点够通用积分机制和元宇宙创意平台计划于2025年上线。

合伙人社群

点点够服务的第一阵营是银联机构和创鑫伙伴,这些都是具有创业激情和梦想的人,基础业务数据都是靠这些人沉淀的,他们对点点够的企业文化及内训具有强烈的信任感,同时对这个国家和社会也具有时代的使命感。

/

商户社群

从刷卡机用户,到收款码商家,再到B2B企业级大型商户,都是机构服务的对象,也是点点够事业奠基的根本,持续为他们提供更具服务价值的支持,将不断拉升对点点够平台的信赖。

持卡人社群

信用卡持卡人的增长是有目共睹的,他们成为了我们重要的创业过滤群体,他们更有理财、管理能力,同时也是渴望财富自由、生活幸福的核心群体。点点够为他们提供专业的用卡服务指导。

扫码消费社群

巨量的扫码消费群体,几乎涵盖所有人。点点够透过积分机制,将线下实际交易数据转化为点点够应用端(微信小程序、云闪付小程序)的多元化服务,为他们提供包括但不限于:线上购物通兑,元宇宙平台充值通兑。

行业资讯

数字经济催生新兴业态,聚合码付打造便捷的支付方式

数字经济催生新兴业态,聚合码付打造便捷的支付方式

随着数字经济的快速发展,新兴业态如雨后春笋般涌现。数字经济以互联网、物联网、人工智能等技术为基础,改变了传统经济的生产、流通和消费方式,带动了新的商业模式和产业形态的诞生。同时,数字经济也创造了一种全新的支付方式,让人们享受到了更加便捷的消费体验。 数字经济催生新兴业态...

央行发布:2023年支付结算工作重点

央行发布:2023年支付结算工作重点

据人民银行官网消息,日前,人民银行召开2023年支付结算工作电视会议。会议全面总结2022年支付结算工作,深入分析当前面临的形势,就2023年重点工作任务作出部署。人民银行党委委员、副行长张青松出席会议并讲话。 会议认为,2022年人民银行支付结算条线认真贯彻落实党中央决策部署,按照行党委工作要求,始终坚持“支付为民”,支付市场治理扎实有效,支付清算基础设施稳健运行,支付普惠进程不断深化,有效服务实体经济和民生发展。...

周小川最新重磅发言!谈及支付业务

中国金融学会第七届理事会会长、中国央行原行长周小川近日在“2023中国金融学会学术年会暨中国金融论坛年会”时发表演讲,谈及支付系统的演进和商业银行个贷模式的选择,认为这与现代化有一定的关系,起因是这些年其一直在观察支付系统和数字货币的进展,而它们正是服务于实体经济。 这些年支付系统的演进变化很快,有很多新技术和新进展,特别是从互联网支付到数字货币,到数字驱动的个人零售业务,下一步可能大家还要研究人工智能会有什么样的影响和作用。...

联系我们

点点够总部在美丽的海滨城市厦门,欢迎随时前来考察指导!网站底部有我们的客服电话,请于上班时间来电!上班时间:周一至周五,上午9:00-晚上9:00.