我已经为添加您自己的此类按钮编写了一个简单而精确的干净解决方案:
class TmMS_Controller extends TmMS {
//...
public function init() {
//...
add_action(\'admin_footer\', array(&$this, \'admin_footer\'));
// ...
}
public function admin_footer() {
if (empty($_GET) OR (isset($_GET[\'post_type\']) AND $_GET[\'post_type\'] == \'post\')) {
if ($_SERVER[\'SCRIPT_URI\'] == admin_url(\'edit.php\')) {
?>
<script type="text/javascript">
jQuery(function() {
jQuery(\'#screen-meta-links\').append(\'<div class="hide-if-no-js screen-meta-toggle" id="mail-subscriber-options-link-wrap" style=""><a aria-expanded="false" aria-controls="screen-options-wrap" class="show-settings" id="mail-subscriber-settings-link" href="#mail-subscriber-options-wrap">Newsplus</a></div>\');
var mail_subscriber_options_wrap = jQuery(\'#mail_subscriber_options\').html();
jQuery(\'#mail_subscriber_options\').remove();
jQuery(\'#screen-meta\').append(mail_subscriber_options_wrap);
});
</script>
<?php
$this->draw_prepared_posts_content();
}
}
}
public function draw_prepared_posts_content() {
$data = array();
echo $this->draw_html(\'admin/prepared_posts_content\', $data);
}
// ...
}
$tm_ms_controller = new TmMS_Controller();
add_action(\'init\', array(&$tm_ms_controller, \'init\'), 1, 999);
在某处添加css说明:
#mail-subscriber-options-link-wrap {
float: right;
height: 23px;
padding: 0;
margin: 0 0 0 6px;
font-family: sans-serif;
}
#mail-subscriber-options-link-wrap {
-webkit-border-bottom-left-radius: 3px;
-webkit-border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
border-bottom-right-radius: 3px;
}
/* screen options and help tabs */
#mail-subscriber-options-link-wrap {
border-right: 1px solid #d1e5ee;
border-left: 1px solid #d1e5ee;
border-bottom: 1px solid #d1e5ee;
background: #eff8ff;
background-image: -webkit-gradient(linear, left bottom, left top, from(#def1ff), to(#eff8ff));
background-image: -webkit-linear-gradient(bottom, #def1ff, #eff8ff);
background-image: -moz-linear-gradient(bottom, #def1ff, #eff8ff);
background-image: -o-linear-gradient(bottom, #def1ff, #eff8ff);
background-image: linear-gradient(to top, #def1ff, #eff8ff);
}
#mail-subscriber-options-posts{
padding: 0;
margin: 0;
}
屏幕: