chore: initial snapshot of 2meet-data-optimizer-hivepress-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:
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* WP_Query interceptor for hp_membership post type.
|
||||
*
|
||||
* @package WP_Data_Optimizer
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* WP_Query interceptor for hp_membership post type.
|
||||
*
|
||||
* Intercepted meta keys:
|
||||
* hp_plan => plan_id (BIGINT)
|
||||
* hp_user => user_id (BIGINT)
|
||||
* hp_price => price (VARCHAR)
|
||||
* hp_order => order_id (BIGINT)
|
||||
* hp_start_date => start_date (DATETIME)
|
||||
* hp_end_date => end_date (DATETIME)
|
||||
*/
|
||||
class TMDO_Memberships_Query extends TMDO_Query_Interceptor_Base {
|
||||
|
||||
/**
|
||||
* Returns the module identifier.
|
||||
*
|
||||
* @return string Module name.
|
||||
*/
|
||||
protected function get_module(): string {
|
||||
return 'memberships';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the post types this interceptor handles.
|
||||
*
|
||||
* @return string[] Post type slugs.
|
||||
*/
|
||||
protected function get_post_types(): array {
|
||||
return array( 'hp_membership' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the custom table name.
|
||||
*
|
||||
* @return string Table name without prefix.
|
||||
*/
|
||||
protected function get_table(): string {
|
||||
return 'hpct_memberships';
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the meta_key to column mapping for hpct_memberships.
|
||||
*
|
||||
* @return array<string, string> Meta key to column name map.
|
||||
*/
|
||||
protected function get_meta_key_map(): array {
|
||||
return array(
|
||||
'hp_plan' => 'plan_id',
|
||||
'hp_user' => 'user_id',
|
||||
'hp_price' => 'price',
|
||||
'hp_order' => 'order_id',
|
||||
'hp_start_date' => 'start_date',
|
||||
'hp_end_date' => 'end_date',
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user