fix(back-compat): hook 橋改雙向 + alias 表修補 + 函式 shim(E1/E2/E5)
E1 雙向 hook 橋
原本只做 tmdo_* → wpdo_* 單向轉發,但核心一律 do_action('wpdo_*')
(core:69,275、custom-table-registry:110、options-manager:59),
所以任何 add_action('tmdo_after_write') 之類的新契約永遠收不到事件。
改為雙向,並以 $GLOBALS['tmdo_hook_relay_active'] 共用旗標防止
A→B→A 迴圈與 listener 重複觸發。
連帶:兩個 test bootstrap 補 do_action_ref_array() stub(單向時不會走到)。
E2 alias 表
- 刪死條目 'TMDO_Notifier'(B 沒有這個類別,此行永不生效)
- 補 'TMDO_Abstract_Notifier' => 'WPDO_Abstract_Notifier'(自訂 notifier 基底)
- trait-wpdo-anti-eav-aware-alias.php 移除與 interface-wpdo-entity-adapter-alias.php
重複的 WPDO_Entity_Adapter_Interface 宣告(composer 曾警告 Ambiguous class resolution)
E5 函式 shim:wpdo_run() / wpdo_load_textdomain() 委派到 tmdo_ 版本
unit 451 / integration 398 GREEN
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TbG1keQQ7XBa7qMQY16KCY
This commit is contained in:
@@ -174,6 +174,11 @@ if ( ! function_exists( 'do_action' ) ) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( ! function_exists( 'do_action_ref_array' ) ) {
|
||||
function do_action_ref_array( string $hook, array $args ): void {
|
||||
do_action( $hook, ...$args );
|
||||
}
|
||||
}
|
||||
if ( ! function_exists( 'wp_next_scheduled' ) ) {
|
||||
function wp_next_scheduled( string $hook ): int|false { return false; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user