如何将自定义HTML/PHP文件添加到如下所示的自定义帖子类型列表的头部?
任何Wordpress函数都可以做到这一点?或者我只能通过JS(jQuery)附加我的自定义内容?
如何将自定义HTML/PHP文件添加到如下所示的自定义帖子类型列表的头部?
任何Wordpress函数都可以做到这一点?或者我只能通过JS(jQuery)附加我的自定义内容?
如果可以的话,你可以admin_notices
. 像这样:
改变post_type
真实的post_type
名称我以为是“程序”。
function wpse_76471_add_html() {
global $pagenow ,$post;
if( $post->post_type == \'program\' && $pagenow == \'edit.php\' ) {
$output = \'<div class="my-div">\';
$output .= \'<h2>\'. __(\'My custom content (HTML/PHP)\', \'program\') .\'</h2>\';
$output .= \'</div>\';
echo $output;
}
}
add_action(\'admin_notices\',\'wpse_76471_add_html\');
div将位于标题上方。。。希望一切顺利。也许你可以使用另一个钩子:http://codex.wordpress.org/Plugin_API/Filter_Reference#Administrative_Filters我想使用wp\\u editor();(自定义编辑器)我尝试了几种方法,但我迷路了,无法保存帖子并在模板中检索内容How to edit posts with the new wp_editor api?而且add_action( \'edit_page_form\', \'my_second_editor\' ); function my_second_editor() { // get and set $content somehow... wp_editor(