'plan_id', 'hp_user' => 'user_id', 'hp_price' => 'price', 'hp_order' => 'order_id', 'hp_start_date' => 'start_date', 'hp_end_date' => 'end_date', ); /** * Returns the WordPress post_type slug handled by this interceptor. * * @return string */ protected function get_post_type(): string { return 'hp_membership'; } /** * Returns the table key passed to TMDO_DB::table(). * * @return string */ protected function get_table_key(): string { return 'hpct_memberships'; } /** * Builds the INSERT row for a newly created membership post. * * @param int $post_id Post ID. * @param \WP_Post $post Post object. * @param string $now Formatted datetime string. * @return array{values: array, formats: array} */ protected function build_insert_data( int $post_id, \WP_Post $post, string $now ): array { return array( 'values' => array( 'post_id' => $post_id, 'user_id' => (int) $post->post_author, 'status' => $post->post_status, 'created_at' => $now, 'updated_at' => $now, ), 'formats' => array( '%d', '%d', '%s', '%s', '%s' ), ); } }