Télécharger l'extension

  1. <?php
  2. /*
  3. Plugin Name: Planet Fr
  4. Plugin URI: http://www.wordpress-fr.net/planet/
  5. Description: Cette extension permet de remplacer le bloc "Autres actualités de WordPress" du tableau de bord par l'actualité francophone du Planet.
  6. Version: 1.0
  7. Author: Amaury Balmer
  8. Author URI: http://wp-box.fr
  9.  
  10. ---
  11. Copyright 2008 Amaury BALMER (balmer.amaury@gmail.com)
  12.  
  13. This program is free software; you can redistribute it and/or modify
  14. it under the terms of the GNU General Public License as published by
  15. the Free Software Foundation; either version 2 of the License, or
  16. (at your option) any later version.
  17.  
  18. This program is distributed in the hope that it will be useful,
  19. but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. GNU General Public License for more details.
  22. */
  23.  
  24. if (is_admin ()) {
  25.     function planet_fr_link($link = '') {
  26.         return 'http://www.wordpress-fr.net/planet/';
  27.     }
  28.     add_filter ( 'dashboard_secondary_link', 'planet_fr_link' );
  29.    
  30.     function planet_fr_feed($feed = '') {
  31.         return 'http://www.wordpress-fr.net/planet/?type=rss10';
  32.     }
  33.     add_filter ( 'dashboard_secondary_feed', 'planet_fr_feed' );
  34.    
  35.     function planet_fr_title($name = '') {
  36.         return 'Autres actualités francophones de WordPress';
  37.     }
  38.     add_filter ( 'dashboard_secondary_title', 'planet_fr_title' );
  39. }
  40.  
  41. function delete_planet_us() {
  42.     $widget_options = get_option ( 'dashboard_widget_options' );
  43.     if (isset ( $widget_options ['dashboard_secondary'] )) {
  44.         unset ( $widget_options ['dashboard_secondary'] );
  45.         update_option ( 'dashboard_widget_options', $widget_options );
  46.     }
  47. }
  48. register_activation_hook ( __FILE__, 'delete_planet_us' );
  49. ?>