Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am new to wordpress development so please be patient if my question sounds simple or ridiculous, since I have been doing object oriented programming in PHP so i wanted to use the OOP approach in wordpress plugin development as well and came across Boilerplate. I have gone through the code in detail but I am still confused.

At present it comes with a view of admin.php, i wanted to create another page for testing purpose so i created a file view/admin2.php, I then want to create a hyperlink in admin.php to redirect the user to admin2.php, how can i do it? if i simply do the following, it does not work and gives me 404 error

<a href="admin2.php">go to admin 2</a>

I know i can create a sub menu but i do not want to do that yet. I will really appreciate any help here.

UPDATE

This is what my admin.php looks like

<?php
echo '<a href="'. plugins_url( 'admin2.php' , __FILE__ ) .'">Go to admin 2 page</a>';
?>

This is what my admin2.php looks like

<?php
echo '<a href="'. plugins_url( 'admin.php' , __FILE__ ) .'">Go to admin page</a>';
?>
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.