Advertisement
Guest User

conditional logic

a guest
May 6th, 2021
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 KB | None | 0 0
  1. [
  2. 'name' => __( 'Réception', 'your-text-domain' ),
  3. 'id' => $prefix . 'reception',
  4. 'type' => 'radio',
  5. 'options' => [
  6. 'cueillette' => __( 'Cueillette', 'your-text-domain' ),
  7. 'livraison' => __( 'Livraison', 'your-text-domain' ),
  8. ],
  9. 'required' => 1,
  10. 'admin_columns' => [
  11. 'position' => 'after courriel',
  12. 'title' => 'Réception',
  13. ],
  14. 'save_field' => 1,
  15. 'inline' => false,
  16. ],
  17. [
  18. 'name' => __( 'Destination', 'your-text-domain' ),
  19. 'id' => $prefix . 'destination',
  20. 'type' => 'group',
  21. 'save_field' => 1,
  22. 'fields' => [
  23. [
  24. 'name' => __( 'Adresse', 'your-text-domain' ),
  25. 'id' => $prefix . 'adresse',
  26. 'type' => 'text',
  27. 'columns' => 8,
  28. 'save_field' => 1,
  29. ],
  30. [
  31. 'name' => __( 'Ville', 'your-text-domain' ),
  32. 'id' => $prefix . 'ville',
  33. 'type' => 'text',
  34. 'columns' => 5,
  35. 'save_field' => 1,
  36. ],
  37. [
  38. 'name' => __( 'Code postal', 'your-text-domain' ),
  39. 'id' => $prefix . 'code_postal',
  40. 'type' => 'text',
  41. 'columns' => 3,
  42. 'save_field' => 1,
  43. ],
  44. ],
  45. 'hidden' => [
  46. 'when' => [['reception', '!=', 'livraison']],
  47. 'relation' => 'or',
  48. ],
  49. ],
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement