如何設置有條件的隱藏按鈕, 我嘗試了 if 都報錯

正在查看 2 個帖子:1-2 (共 2 個帖子)
  • 作者
    帖子
  • hl8431610
    參與者
    • 文章數量: 1
    @hl8431610
    樓主

    add_filter(‘woocommerce_my_account_my_orders_actions’, ‘remove_wps_cutomer_order_msg’, 10, 2);
    function remove_wps_cutomer_order_msg($actions, $order){
    unset($actions[‘view_msg’]);
    return $actions;
    }

    怎麼在這段代碼中加上訂單狀態中才顯示按鈕,然後多少天后按鈕消失不見。有沒有辦法

    詩語
    管理員
    • 文章數量: 5,932
    @feibisi

    上面串是訂單通知信息代碼吧,訂單狀態頁的代碼你需要去 woocommerce/my-account 插件目錄裏找到 order 相關的 PHP 文件裏翻需要顯示狀態的代碼。

正在查看 2 個帖子:1-2 (共 2 個帖子)
  • 哎呀,回覆話題必需登錄。

話題信息

  • 當前位於:WooCommerce
  • 1 條回覆
  • 2 個參與人
  • 最後回覆:<a href="https://bbs.weixiaoduo.com/users/feibisi/" title=" 查看詩語的個人資料" class="bbp-author-link"><span class="bbp-author-name"> 詩語</span></a>
  • 上次活動:<a href="https://bbs.weixiaoduo.com/topic/41702/#post-41703" title=" 回覆至:如何設置有條件的隱藏按鈕, 我嘗試了 if 都報錯">2 年、 6 月前</a>