さて、あなたは私たちがフックすることができ、それにはアクションがないことを見たコアファイルを開いた場合。
フィルタが2つしかありません。この
add_filter('views_edit-movies', 'so_13813805_add_button_to_views');
function so_13813805_add_button_to_views($views)
{
$views['my-button'] = '<button id="update-from-provider" type="button" title="Update from Provider" style="margin:5px">Update from Provider</button>';
return $views;
}
は、それが生成する:
:
あなたが好きなところから、おおよその位置に置くには、次のように使用我々は、次を使用することができます
add_action('admin_head-edit.php', 'so_13813805_move_custom_button');
function so_13813805_move_custom_button()
{
global $current_screen;
// Not our post type, exit earlier
if('movies' != $current_screen->post_type)
return;
?>
<script type="text/javascript">
jQuery(document).ready(function($)
{
$('#update-from-provider').prependTo('span.displaying-num');
});
</script>
<?php
}
この結果は次のとおりです。
同じスクリーンショットを共有できますか? –
@ sunil221スクリーンショットをご覧ください。おかげさまで –
@LeapBunボタンクリック後にコードを呼び出す方法は? – Celik