I am developing a WordPress plugin to show me a series of articles and specific fields. Until everything is correct and done, I have done this with Custom Post Type. But I would like to give plugin more functionality and it is to be able to add an Import button in the post listing next to Add new. The button I could put it but I can not implement the logic of that button. I put the code to insert said button
add_action( 'admin_head',array($this,'custom_js_to_head'));
function custom_js_to_head()
{
?>
<script>
jQuery(function(){
jQuery("body.post-type-productos .wrap h1").append('<a href="index.php?param=your-action" class="page-title-action">Importar</a>');
});
</script>
<?php
}
It's the only thing I have and of course when clicking on the button, it does not do anything ...
I hope you can help me.
Greetings