我正在尝试将插件界面添加到类别编辑器中。我使用add\\u meta\\u box()过滤器轻松地将其附加到帖子和页面编辑器,但在类别编辑器上似乎没有add\\u meta\\u box挂钩。
因此,由于我已经在使用add\\u filter(“edit\\u category\\u form”,“my\\u category\\u editor\\u function”,1)向category edit屏幕添加了一些额外字段,我想知道是否可以从该函数中调用我的插件脚本?
示例:
add_filter(\'edit_category_form\', \'my_category_editor_function\', 1);
function my_category_editor_function($tag) {
$tag_extra_fields = get_option(\'my_category_editor_function\');?>
<!--This is where I would call my plugin interface-->
<div style="float:right;top:0;right:0">
<?php
/*
load my widget here. May have to use some funky css to get it to float
to the right of the cat editor just like it does in the post editor
*/
?>
</div>
<!--This is my current fields added with the filter-->
<table class="form-table">
<tr class="form-field">
<th scope="row" valign="top"><label for="_my-categoryTitle">Category Title</label></th>
<td><input name="_my-categoryTitle" id="_my-categoryTitle" type="text" size="40" aria-required="false" value="<?php echo $tag_extra_fields[$tag->term_id][\'my_cat_title\']; ?>" />
<p class="description">The title is optional but will be used in place of the name on the home page category index (when in list view) and on the category landing page.</p>
</td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="_my-categoryKeywords">Keywords</label></th>
<td valign="top"><input name="_my-categoryKeywords" id="_my-categoryKeywords" type="text" size="40" aria-required="false" value="<?php if(isset($tag_extra_fields[$tag->term_id][\'my_cat_keywords\']))echo $tag_extra_fields[$tag->term_id][\'my_cat_keywords\']; ?>" />
<p class="description">Optional: If you want to add a keywords metatag to the category landing page and keywords in the Category image\'s alt tag.</p>
</td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="_my-categoryImageLink">Image Link</label></th>
<td valign="top"><input name="_my-categoryImageLink" id="_my-categoryImageLink" type="text" size="40" aria-required="false" value="<?php if(isset($tag_extra_fields[$tag->term_id][\'my_cat_imageLink\']))echo $tag_extra_fields[$tag->term_id][\'my_cat_imageLink\']; ?>" />
<p class="description">Optional: If you want to link the <b>category landing page image</b> to an affiliate or CPA offer, place your link here.</p>
</td>
</tr>
<tr class="form-field">
<th scope="row" valign="top"><label for="_my-categoryAds">Hide Ads?</label></th>
<td><input name="_my-categoryAds" id="_my-categoryAds" type="checkbox" style="width:30px;float:left;"<?php if(isset($tag_extra_fields[$tag->term_id][\'my_cat_ads\'])) echo \' checked="checked"\'; ?>" />
<p class="description"><label for="_my-categoryAds">Check this to remove ads from this category\'s landing page. (Does not affect ads placed in widgets)</label></p>
</td>
</tr>
</table>