1

I developed a plugin to view exam data in tabular format. I wan to show add new button at top left corner. This button will redirect a url. I generated this url in two way:

  <a href="<?php echo plugins_url('includes/add_exam.php',__FILE__); ?>" class="page-title-action">Add New</a>

       <?php echo sprintf('<a href="?page=%s&action=%s" class="page-title-action">Add New</a>',$_REQUEST['page'],'add'); ?>

This tow lines generate two url as like:

http://localhost/wordpress/wp-content/plugins/absb_online_exam/includes/includes/add_exam.php

and

http://localhost/wordpress/wp-admin/admin.php?page=exam_list&action=add

respectively. After redirecting this I will do rest of coding to add new entry. I am new in wordpress. Hence I am afraid of standard of wordpress best practice. Any suggestion. If my two approach is wrong please give some instructions. Thanks in advance.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.