function get_user_by_staff_id($user_ID) {
$results = $wpdb->get_results("SELECT id FROM wp_ab_staff WHERE wp_user_id = \'$user_ID\' LIMIT 1 ");
$staff_id = $results;
return $staff_id;
}
将此添加到您的函数中。php(不是Booklys!!)
然后,要使用它,您可以执行以下操作:
<?php echo do_shortcode(\'[bookly-form category_id="1" service_id="4" staff_member_id="\'. get_user_by_staff_id(**USER ID HERE**) .\'" hide="categories,services,staff_members,week_days"]\'); ?>