Guest User

Untitled

a guest
Dec 11th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2.  
  3. class Providers extends Plugin {
  4.  
  5. /**
  6. *
  7. */
  8. public function filter_admin_access( $access, $page, $post_type ) {
  9. if ( $page != 'providers' ) {
  10. return $access;
  11. }
  12. return true;
  13. }
  14.  
  15. /**
  16. *
  17. */
  18. public function action_admin_theme_get_providers( $handler, $theme )
  19. {
  20. $content = "<div class='container'><table><thead><th>Feature</th><th>Provided by</th></thead><tbody>";
  21. foreach( Plugins::provided() as $feature => $provided_by ) {
  22. $content .= _t( "<tr><td>%s</td><td>%s</td></tr>", array ($feature, implode( $provided_by, ", ") ));
  23. }
  24. $content .= "</tbody></table></div>";
  25. $theme->content = $content;
  26. $theme->display( 'blank' );
  27. exit;
  28. }
  29. }
  30. ?>
Add Comment
Please, Sign In to add comment