@@ -129,15 +129,16 @@ public function render_api_details_meta_box($post)
129
129
?>
130
130
<table class="form-table">
131
131
<tr>
132
- <th scope="row"><label for="custom_api_endpoint"><?php _e ('API Endpoint ' , 'custom-api-creator ' ); ?> </label></th>
132
+ <th scope="row"><label
133
+ for="custom_api_endpoint"><?php esc_html_e ('API Endpoint ' , 'custom-api-creator ' ); ?> </label></th>
133
134
<td>
134
135
<input type="text" id="custom_api_endpoint" name="custom_api_endpoint"
135
136
value="<?php echo esc_attr ($ endpoint ); ?> " class="regular-text" required>
136
- <p class="description"><?php _e ('Example: my-custom-api/[parameter] ' , 'custom-api-creator ' ); ?> </p>
137
+ <p class="description"><?php esc_html_e ('Example: my-custom-api/[parameter] ' , 'custom-api-creator ' ); ?> </p>
137
138
</td>
138
139
</tr>
139
140
<tr>
140
- <th scope="row"><?php _e ('API Sections ' , 'custom-api-creator ' ); ?> </th>
141
+ <th scope="row"><?php esc_html_e ('API Sections ' , 'custom-api-creator ' ); ?> </th>
141
142
<td>
142
143
<div id="api_sections">
143
144
<?php
@@ -151,28 +152,28 @@ public function render_api_details_meta_box($post)
151
152
?>
152
153
</div>
153
154
<button type="button" id="add_section"
154
- class="button"><?php _e ('Add Section ' , 'custom-api-creator ' ); ?> </button>
155
+ class="button"><?php esc_html_e ('Add Section ' , 'custom-api-creator ' ); ?> </button>
155
156
</td>
156
157
</tr>
157
158
<tr>
158
- <th scope="row"><?php _e ('Access Type ' , 'custom-api-creator ' ); ?> </th>
159
+ <th scope="row"><?php esc_html_e ('Access Type ' , 'custom-api-creator ' ); ?> </th>
159
160
<td>
160
161
<fieldset>
161
- <legend class="screen-reader-text"><?php _e ('Access Type ' , 'custom-api-creator ' ); ?> </legend>
162
+ <legend class="screen-reader-text"><?php esc_html_e ('Access Type ' , 'custom-api-creator ' ); ?> </legend>
162
163
<label>
163
164
<input type="radio" name="custom_api_access_type" value="public" <?php checked ($ access_type , 'public ' ); ?> >
164
- <?php _e ('Public ' , 'custom-api-creator ' ); ?>
165
+ <?php esc_html_e ('Public ' , 'custom-api-creator ' ); ?>
165
166
</label>
166
167
<br>
167
168
<label>
168
169
<input type="radio" name="custom_api_access_type" value="private" <?php checked ($ access_type , 'private ' ); ?> >
169
- <?php _e ('Private ' , 'custom-api-creator ' ); ?>
170
+ <?php esc_html_e ('Private ' , 'custom-api-creator ' ); ?>
170
171
</label>
171
172
</fieldset>
172
173
</td>
173
174
</tr>
174
175
<tr id="custom_api_roles_row" style="<?php echo $ access_type === 'private ' ? '' : 'display: none; ' ; ?> ">
175
- <th scope="row"><?php _e ('User Roles ' , 'custom-api-creator ' ); ?> </th>
176
+ <th scope="row"><?php esc_html_e ('User Roles ' , 'custom-api-creator ' ); ?> </th>
176
177
<td>
177
178
<?php foreach ($ all_roles as $ role => $ name ):
178
179
$ checked = in_array ($ role , $ roles );
@@ -193,14 +194,14 @@ private function render_section_fields($post_types, $all_taxonomies, $index, $se
193
194
<h4><?php printf (__ ('Section %d ' , 'custom-api-creator ' ), $ index + 1 ); ?> </h4>
194
195
<p>
195
196
<label>
196
- <?php _e ('Property Name: ' , 'custom-api-creator ' ); ?>
197
+ <?php esc_html_e ('Property Name: ' , 'custom-api-creator ' ); ?>
197
198
<input type="text" name="custom_api_sections[<?php echo $ index ; ?> ][name]"
198
199
value="<?php echo esc_attr ($ section ['name ' ]); ?> " class="regular-text">
199
200
</label>
200
201
</p>
201
202
<p>
202
203
<label>
203
- <?php _e ('Post Type: ' , 'custom-api-creator ' ); ?>
204
+ <?php esc_html_e ('Post Type: ' , 'custom-api-creator ' ); ?>
204
205
<select name="custom_api_sections[<?php echo $ index ; ?> ][post_type]" class="section-post-type">
205
206
<?php foreach ($ post_types as $ pt ): ?>
206
207
<option value="<?php echo esc_attr ($ pt ->name ); ?> " <?php selected ($ section ['post_type ' ], $ pt ->name ); ?> >
@@ -211,7 +212,7 @@ private function render_section_fields($post_types, $all_taxonomies, $index, $se
211
212
</label>
212
213
</p>
213
214
<p>
214
- <label><?php _e ('Fields: ' , 'custom-api-creator ' ); ?> </label><br>
215
+ <label><?php esc_html_e ('Fields: ' , 'custom-api-creator ' ); ?> </label><br>
215
216
<?php
216
217
$ available_fields = array ('title ' , 'content ' , 'excerpt ' , 'categories ' , 'tags ' );
217
218
foreach ($ available_fields as $ field ):
@@ -223,7 +224,7 @@ private function render_section_fields($post_types, $all_taxonomies, $index, $se
223
224
<?php endforeach ; ?>
224
225
</p>
225
226
<p>
226
- <label><?php _e ('Taxonomies: ' , 'custom-api-creator ' ); ?> </label><br>
227
+ <label><?php esc_html_e ('Taxonomies: ' , 'custom-api-creator ' ); ?> </label><br>
227
228
<?php foreach ($ all_taxonomies as $ tax ):
228
229
$ checked = in_array ($ tax ->name , $ section ['taxonomies ' ]);
229
230
?>
@@ -233,7 +234,8 @@ private function render_section_fields($post_types, $all_taxonomies, $index, $se
233
234
<?php endforeach ; ?>
234
235
</p>
235
236
<?php if ($ index > 0 ): ?>
236
- <button type="button" class="button remove-section"><?php _e ('Remove Section ' , 'custom-api-creator ' ); ?> </button>
237
+ <button type="button"
238
+ class="button remove-section"><?php esc_html_e ('Remove Section ' , 'custom-api-creator ' ); ?> </button>
237
239
<?php endif ; ?>
238
240
</div>
239
241
<?php
0 commit comments