I need to create, retrieve, update and display a custom field in Wordpress tags. This code works for displaying the custom field, but its deprecated.
function tag_edit_form_fields ( $term ) {
?>
<tr class="form-field">
<th scope="row"><label for="term-colorpicker">Custom Field: </label></th>
<td>
<input type="custom_field" name="_custom_field" value=" <?php echo $custom_value; ?>" id="term-custom_term" />
<p class="description">This is a custom field.</p>
</td>
</tr>
<?php
}
add_action('edit_tag_form_fields','tag_edit_form_fields');
Using the new function {$taxonomy}_edit_form_fields
as tag_edit_form_fields
doesn't seem to work.
I need to create, retrieve, update and display a custom field in Wordpress tags. This code works for displaying the custom field, but its deprecated.
function tag_edit_form_fields ( $term ) {
?>
<tr class="form-field">
<th scope="row"><label for="term-colorpicker">Custom Field: </label></th>
<td>
<input type="custom_field" name="_custom_field" value=" <?php echo $custom_value; ?>" id="term-custom_term" />
<p class="description">This is a custom field.</p>
</td>
</tr>
<?php
}
add_action('edit_tag_form_fields','tag_edit_form_fields');
Using the new function {$taxonomy}_edit_form_fields
as tag_edit_form_fields
doesn't seem to work.
1 Answer
Reset to default 2While adding the tags to this stack exchange question, I added tags
and the hint showed up as post_tag
.
So, I tried
add_action('post_tag_edit_form_fields','tag_edit_form_fields');
and it works!
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742404966a4437659.html
评论列表(0条)