I would like another "Add post" button in the admin except I am going to call it "Add voucher". It will run specific plugins that add post will not. However that is irrelivant, all I need to know it how to add another add post button with the same features.

1 Answer 1


Unfortunately this isn't possible (without a slight hack)- since there are no hooks provided (see for example the edit.php page).

A quick and easy hack is to use JavaScript to add the link after the usual 'Add New' link. Here I've used the admin_print_footer_scripts hook (on 'post', or 'edit-post' screens) to print the JavaScript. Note that you must alter this to work for other post types.

function wpse57033_add_new_voucher_link(){
    $screen = get_current_screen();
    if( $screen->id == 'edit-post' || $screen->id == 'post' ){
            jQuery('.wrap h2 .add-new-h2').after('<a href="" class="add-new-h2">Add New Voucher</a>');
  • @RuturaajPatki asked why some people check $variable == 'value' and others 'value'== $variable. I've been lazy in this answer, but the latter is best practise (see this for an explanation). Otherwise they are the same. Jul 1, 2012 at 14:29
  • $screen is an object, when making comparisons, it can help to force (string) type in the evaluation. Example Code: if( ( (string)$screen->id == 'user-edit' || (string)$screen->id == 'users' ) && ( current_user_can('editor') || current_user_can('administrator') ) ){ // do stuff } Screen Type Reference: codex.wordpress.org/Plugin_API/Admin_Screen_Reference Mar 16, 2018 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.