plug_dashboard.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. if (!class_exists("plug_dashboard")) {
  3. class plug_dashboard {
  4. function __construct($ns) {
  5. $this->title = __("Dashboard","dagsopt");
  6. $this->pluginname = $ns->pluginname;
  7. $this->file = $ns->file;
  8. $this->ns = $ns;
  9. }
  10. function start(){
  11. add_action( 'wp_dashboard_setup' , array(&$this,'remove_dashboard_widgets'), 113 );
  12. }
  13. function remove_dashboard_widgets() {
  14. remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
  15. remove_meta_box( 'dashboard_right_now', 'dashboard', 'normal' );
  16. remove_meta_box( 'dashboard_browser_nag', 'dashboard', 'normal' );
  17. remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
  18. remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
  19. remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
  20. remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );
  21. }
  22. function Option($pre){
  23. //update_option ( $pre.'_width', $_POST [ $pre.'_width' ] );
  24. }
  25. function help(){
  26. ?>
  27. <?php echo(__("Clean dashboard in admin mode","dagsopt")) ?><br>
  28. <?php
  29. }
  30. function admin_line($pre){
  31. ?>
  32. <?php
  33. }
  34. }
  35. /*
  36. function example_dashboard_widget_function() {
  37. echo "Hello World, I'm a great Dashboard Widget";
  38. }
  39. function example_add_dashboard_widgets() {
  40. wp_add_dashboard_widget('example_dashboard_widget', 'Example Dashboard Widget', 'example_dashboard_widget_function');
  41. }
  42. add_action('wp_dashboard_setup', 'example_add_dashboard_widgets' );
  43. */
  44. global $plug_dashboard;
  45. $plug_dashboard = new plug_dashboard($this);
  46. $this->dagsopt['plug_dashboard'] = $plug_dashboard;
  47. }