chore: initial snapshot of 2meet-data-optimizer-hub-addon v0.1.0

Baseline before backporting wp-data-optimizer v3.0.1-v3.4.6.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
This commit is contained in:
2026-07-31 05:06:36 +08:00
commit 7f788cb4dc
15 changed files with 2711 additions and 0 deletions
+43
View File
@@ -0,0 +1,43 @@
<?php
/**
* Hub vendor postmeta field registration.
*
* 從 2meet-hub-core/includes/class-tmhc-plugin.php:204-213 抽出。
*
* @package TMDO_HUB
* @since 0.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
final class TMDO_Hub_Vendor_Field {
private static bool $registered = false;
/**
* Register `_2meet_global_vendor_id` to cold zone for hp_vendor post type.
*
* @param object $registry TMDO_Schema_Registry / WPDO_Schema_Registry instance.
*/
public static function register( $registry ): void {
if ( self::$registered ) {
return;
}
if ( ! is_object( $registry ) || ! method_exists( $registry, 'register' ) ) {
return;
}
$registry->register(
'2meet-data-optimizer-hub-addon',
array(
'meta_key' => '_2meet_global_vendor_id',
'post_type' => 'hp_vendor',
'zone' => 'cold',
'data_type' => 'bigint',
'indexed' => true,
)
);
self::$registered = true;
}
}