I’m wondering how I can make a plugin to output some data via the admin panel.
Just to get me going what code would make a page in the admin panel (for only administrators) to display time()?
Leave a Reply
You must be logged in to post a comment.
I’m wondering how I can make a plugin to output some data via the admin panel.
Just to get me going what code would make a page in the admin panel (for only administrators) to display time()?
You must be logged in to post a comment.
It’s actually very easy, you only need two things:
admin_footer
action will cause your plugin’s output to be displayed in the footer of the admin page. There’s a wide range of actions for all kinds of situations and conditions.The PHP
date()
function will give you the current time, so you just need to write a function in your plugin that doesecho date()
, and then useadd_action
to get your PHP function executed in response to the appropriate WordPress action.So to make it completely clear, your plugin code would look like this (not tested!):