如果预订待处理、已取消且未付款,请禁用 WCFM 中的预订状态更新选项

Disable Booking status update option in WCFM if booking is pending, Cancelled & unpaid

我正在使用 wcfm 的 Hook 来禁用状态更新选项,但它不起作用。我想限制供应商更新状态。

add_action( 'wcfm_booking_overview_block', 'disable_cancelled_booking', 20, 2 ); 
function disable_cancelled_booking($booking, $product) { 
global $current_user; //Get User Role 
$user_roles = $current_user->roles; 
$user_role = array_shift($user_roles);

//Checking Status of booking & role of the current user based on that the status update field will be hidden 
if(($booking->status == "cancelled" || $booking->status == "unpaid"|| $booking->status == "pending-confirmation") && $user_role =="wcfm_vendor") { 
//Disable option
 } } 

有一个来自 wcfm“wcfm_is_allow_booking_status_update”的过滤器可以解决问题