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.


This is what my admin.php looks like

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

This is what my admin2.php looks like

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

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.