function _register_hooks()
 {
     add_action('template_redirect', array(&$this, 'restore_request_uri'), 1);
     // These two things cause conflicts in NGG. So we temporarily
     // disable them and then reactivate them, if they were used,
     // in the restore_request_uri() method
     if (has_action('template_redirect', 'wp_old_slug_redirect')) {
         remove_action('template_redirect', 'wp_old_slug_redirect');
         if (!is_null(self::$_use_canonical_redirect)) {
             self::$_use_old_slugs = TRUE;
         }
     }
     if (has_action('template_redirect', 'redirect_canonical')) {
         remove_action('template_redirect', 'redirect_canonical');
         if (!is_null(self::$_use_canonical_redirect)) {
             self::$_use_canonical_redirect = TRUE;
         }
     }
 }
 function fix_wpml_canonical_redirect()
 {
     M_WordPress_Routing::$_use_canonical_redirect = FALSE;
     M_WordPress_Routing::$_use_old_slugs = FALSE;
 }