` / `` tags)
34 |
35 | ```
36 | $php if ( get_field('field_name') ) : ?>
37 | $php echo get_field('field_name'); ?>
38 | $php endif; ?>
39 | ```
40 |
41 | **`field:date` (HTML)**
42 |
43 | Get and format a date field
44 |
45 | ```
46 |
47 | format('d-m-Y'); ?>
48 |
49 | ```
50 |
51 | **`field:if` / `field:ifelse` (HTML)**
52 |
53 | Field conditional. Also used for true/false fields.
54 |
55 | ```
56 |
57 |
58 | ```
59 |
60 | ### Image Field
61 |
62 | **`field:image` (HTML)**
63 |
64 | Image field with a return value of "Image URL"
65 |
66 | ```
67 |
68 |
69 |
70 | ```
71 |
72 | **`field:image:id` (HTML)**
73 |
74 | Image field with a return value of "Image ID"
75 |
76 | ```
77 |
84 | ```
85 |
86 | **`field:image:object` (HTML)**
87 |
88 | Image field with a return value of "Image Object"
89 |
90 | ```
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 | ```
101 | ### File Field
102 |
103 | **`field:file` (HTML)**
104 |
105 | File field with a return value of "File URL"
106 |
107 | ```
108 |
109 | Download File
110 |
111 | ```
112 |
113 | **`field:file:id` (HTML)**
114 |
115 | File field with a return value of "File ID"
116 |
117 | ```
118 |
124 |
125 |
126 | ```
127 |
128 | **`field:file:object` (HTML)**
129 |
130 | File field with a return value of "File Object"
131 |
132 | ```
133 |
134 |
135 |
136 | ```
137 | ### Relationship Field
138 |
139 | **`field:relationship` (HTML)**
140 |
141 | Get a relationship field and loop over all returned posts.
142 | ```
143 |
144 |
145 |
` tags. 315 | 316 | ``` 317 |]]> 6 | 7 |318 | 319 |320 | ``` 321 | -------------------------------------------------------------------------------- /html-date-field.sublime-snippet: -------------------------------------------------------------------------------- 1 |2 | 11 | -------------------------------------------------------------------------------- /html-dump-field.sublime-snippet: -------------------------------------------------------------------------------- 1 |3 | 4 | ${TM_PHP_OPEN_TAG:php} echo \$date->format('${3:d-m-Y}'); ?> 5 | ${TM_PHP_OPEN_TAG:php} endif; ?>]]> 6 | 7 |field:date 8 |ACF date field 9 |text.html - source.php 10 |2 | 3 | 4 | ${TM_PHP_OPEN_TAG:php} var_dump(get_field('${1:field_name}')); die(); ?> 5 |
${TM_PHP_OPEN_TAG:php} echo get_field('${1:field_name}'); ?>
5 | ${TM_PHP_OPEN_TAG:php} endif; ?>]]> 6 |