Created
August 27, 2012 20:16
-
-
Save MattRead/3491900 to your computer and use it in GitHub Desktop.
providers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Providers extends Plugin { | |
/** | |
* | |
*/ | |
public function filter_admin_access( $access, $page, $post_type ) { | |
if ( $page != 'providers' ) { | |
return $access; | |
} | |
return true; | |
} | |
/** | |
* | |
*/ | |
public function action_admin_theme_get_providers( $handler, $theme ) | |
{ | |
$content = "<div class='container'><table><thead><th>Feature</th><th>Provided by</th></thead><tbody>"; | |
foreach( Plugins::provided() as $feature => $provided_by ) { | |
$content .= _t( "<tr><td>%s</td><td>%s</td></tr>", array ($feature, implode( $provided_by, ", ") )); | |
} | |
$content .= "</tbody></table></div>"; | |
$theme->content = $content; | |
$theme->display( 'blank' ); | |
exit; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment