[gnomeweb-wp: 5/13] Adding the gs_ namespace to functions declared in the theme



commit 3ec5633e5dad5721125fe4e4802cf05c9697c33c
Author: Lincoln de Sousa <lincoln comum org>
Date:   Wed Nov 10 19:57:44 2010 -0200

    Adding the gs_ namespace to functions declared in the theme

 wp-content/themes/gnome-grass/database-export.php |    2 +-
 wp-content/themes/gnome-grass/functions.php       |   10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/wp-content/themes/gnome-grass/database-export.php b/wp-content/themes/gnome-grass/database-export.php
index 6a79255..0531f24 100644
--- a/wp-content/themes/gnome-grass/database-export.php
+++ b/wp-content/themes/gnome-grass/database-export.php
@@ -8,7 +8,7 @@
 
 require_once(ABSPATH . "wp-config.php");
 
-function generate_po_xml () {
+function gs_generate_po_xml () {
   global $wpdb;
 
   $myrows = $wpdb->get_results("
diff --git a/wp-content/themes/gnome-grass/functions.php b/wp-content/themes/gnome-grass/functions.php
index 6f7294b..01eddd9 100644
--- a/wp-content/themes/gnome-grass/functions.php
+++ b/wp-content/themes/gnome-grass/functions.php
@@ -87,16 +87,18 @@ add_filter('gallery_style', create_function('$a', 'return preg_replace("%
 
 %s", "", $a);'));
 
+define (THEME_DIR, dirname (__FILE__));
+
 /* This action will be fired when a post/page is updated. It's used to
  * update (regenerate, actually) the pot file with all translatable
  * strings of the gnome.org website. */
-function update_pot_file ($post) {
-  $podir = WP_CONTENT_DIR . '/themes/gnome-grass/po/';
+function gs_update_pot_file ($post) {
+  $podir = THEME_DIR . '/po/';
   $xml_file = "{$podir}.tmp.xml";
-  file_put_contents ($xml_file, generate_po_xml ());
+  file_put_contents ($xml_file, gs_generate_po_xml ());
   exec ("/usr/bin/xml2po -o {$podir}gnome.org.pot $xml_file");
   unlink ($xml_file);
 }
-add_action ('post_updated', 'update_pot_file');
+add_action ('post_updated', 'gs_update_pot_file');
 
 ?>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]