You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WPDataTables:将当前用户ID插入PRODUCER ID列问题求助

问题

我有一个MySQL表,表结构如下:
My Table

我需要在用户添加新条目时,把get_current_user_id()的结果自动插入到PRODUCER ID列,但始终无法实现。我试过两种方法都没用:

  • 使用Transform Value功能
  • 自定义代码片段(代码如下)
function filterColumnIDValue( $columnIDValue, $columnKey, $rowID, $columnID, $table_id){
// 针对特定表ID - 此处为26
if ($table_id == 26) {
    // 筛选目标列(列的原始表头)- 此处为'producer_id'
    if ($columnID == 'producer_id') {
            $columnIDValue = get_current_user_id();
        }
    }
return $columnIDValue;

求解决方法。

内容的提问来源于stack exchange,提问作者Segismunda

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 00:02:03