WordPress – Add External Link as iFrame Under Admin Dashboard Menu Item
Image via WebFactory
In WordPress, you can create your own links in the Admin Nav. WordPress offers a clear and detailed documentation on how to add admin menus. However, instead of having your own page, what if you simply want to embed an external page into your admin nav? All you have to do is to paste this script in your functions.php – but remember to insert your desired URL!
What does the script do?
What the first function ‘oa_register_menu_document’ does is to add an item called ‘Manual’ linked to a new page that we create in the function ‘ oa_view_document_page’ to the admin menu.
In the ‘oa_view_document_page’ function, we then add a simple iframe that links to ‘URL’ (replace with a proper domain). That’s all! When an admin user clicks on the link on the admin nav menu, they will see a new page on your wp-admin, with the URL you’ve linked to embedded as an iframe seamlessly.
At Oangle, we’ve found this method incredibly useful in our web development for external documentations such as admin manual on managing the site using the wp-admin. There are plenty of other possible use cases that are possible using this script.
Unsure of where to insert this? Don’t want to break anything? Our team of WordPress developers in Singapore can accomplish this job for you safely and efficiently. We are highly experienced in WordPress design and development and are equipped in solving any WordPress issues you might be facing. Drop us a line to learn more about what we can do for you and our expertise in WordPress website development.