WordPress plugin attribution footer — update

In a recent post I showed how to put an attribution in the footer of your plugin’s admin screen. In the example I gave, I used a format of:

MyWidget plugin | Version 1.0

I have seen a few plugins already updated and using this methodology, but for the most part authors are adding a third bit of information to that string, namely, themselves.

MyWidget plugin | Version 1.0 | by John Smith

Another thing that has happened since I posted that is that Ozh came up with a better way to call the in_admin_footer hook. Rather than calling it during init and then having to keep testing to see what page is being displayed, he simply dropped the call into the function that creates the actual admin page. That way, it’s only ever called in the first place when the admin page is created. Nice improvement.

So in the continued interest of creating a relative standard, here’s an updated version of the footer plugin, including the author information:

function myplugin_admin_footer() {
	$plugin_data = get_plugin_data( __FILE__ );
	printf('%1$s plugin | Version %2$s | by %3$s<br />', $plugin_data['Title'], $plugin_data['Version'], $plugin_data['Author']);
}

Remember to take the add_action and put it inside the function that echoes the admin page. As a reminder, here’s the add_action that calls that footer:

add_action( 'in_admin_footer', 'myplugin_admin_footer' );

The original article is here.

…and to all the people in the USA who are (not) reading this tonight, Happy 4th of July! :)

[A further post on this topic is here.]

This entry was posted in GUI Goodness, Webcraft and tagged , , , , . Bookmark the permalink.

2 Responses to WordPress plugin attribution footer — update

  1. Pingback: Recent URLs tagged Attribution - Urlrecorder

  2. Pingback: SEO Booster Lite 1.9.2 | myWordPress

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>