Skip to content

Instantly share code, notes, and snippets.

@MattRead
Created August 27, 2012 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MattRead/3491900 to your computer and use it in GitHub Desktop.
Save MattRead/3491900 to your computer and use it in GitHub Desktop.
providers
<?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