Plugin Directory

Changeset 541230


Ignore:
Timestamp:
05/08/2012 08:55:13 AM (14 years ago)
Author:
3dolab
Message:

adding version 0.6

Location:
qtranslate-slug-with-widget
Files:
5 added
3 edited

Legend:

Unmodified
Added
Removed
  • qtranslate-slug-with-widget/trunk/CHANGELOG

    r346654 r541230  
    11qTranslate slug with widget
     2
     3= 0.6 (2012.05.08) =
     4    * Bugfix in saving category fields (line 849)
     5    * Slug translation improved by codetavern & ilpiac
     6
     7= 0.5 (2011.09.17) =
     8    * Category slug translation implemented by Matteo Plebani: matteo@comunicrea.com
     9    * Un-tested attempt to support custom post types (including WP E-commerce products)
     10    * Un-tested attempt to remove translated slugs when a post is deleted
    211
    312= 0.4 (2011.02.17) =
  • qtranslate-slug-with-widget/trunk/qtranslate-slug-with-widget.php

    r439452 r541230  
    44Plugin URI: http://www.3dolab.net/261/qtranslateslug-plugin-widget
    55Plugin Description: Allows to define a slug for each language. Widget for language selection
    6 Version: 0.5
    7 Author: 3DOlab
     6Version: 0.6
     7Author: 3DOlab, teonsight
    88Author URI: http://www.3dolab.net
    99
     
    111111 
    112112  if (isset($q['name'])) {
    113     $type = QTS_POST;
    114     $slug = $q['name'];
    115     $param = 'p';
    116     $get_link = 'get_permalink';
    117     unset($new_q['name']);
     113    $id = qTranslateSlug_get_page_by_path($q['name'], $lang);
     114    if ($id) {
     115        unset($new_q['name']);
     116        $q = $new_q;
     117        $q['page_id'] = $id;
     118        $get_link = 'get_page_link';
     119    } else {
     120    $type = QTS_POST;
     121        $slug = $q['name'];
     122        $param = 'p';
     123        $get_link = 'get_permalink';
     124        unset($new_q['name']);
     125    }
    118126  } else if (isset($q['pagename'])) {
    119127    //$type = QTS_PAGE;
     
    139147    $get_link = 'get_tag_link';
    140148    unset($new_q['tag']);
    141   }
     149  }else{
     150        $path = trim(preg_replace('/\?(.*)/', '', $_SERVER['REQUEST_URI']), '/');
     151        $id = qTranslateSlug_get_page_by_path($path, $lang);
     152        if ($id) {
     153            if (isset ($q['attachment'])) {
     154                unset($q['attachment']);
     155                unset($new_q['attachment']);
     156            }
     157            $q = $new_q;
     158            $q['page_id'] = $id;
     159            $get_link = 'get_page_link';
     160        }
     161   }
    142162 
    143163  if (isset($type)){
     
    336356add_filter('category_link',     'qTranslateSlug_category_link', 0, 2);
    337357add_filter('tag_link',          'qTranslateSlug_tag_link');
     358add_filter('term_link',         'qTranslateSlug_category_link', 0, 2);
    338359//add_filter('the_permalink',          'qTranslateSlug_convertURL', 0, 4);
    339360
     
    347368  remove_filter('category_link', 'qtrans_convertURL');
    348369  remove_filter('tag_link', 'qtrans_convertURL');
     370  remove_filter('term_link', 'qtrans_convertURL');
    349371  //remove_filter('the_permalink', 'qtrans_convertURL');
    350372}
     
    847869}
    848870
    849 function save_qTranslateSlug_category_fileds( $term_id ) {
     871function save_qTranslateSlug_category_fields( $term_id ) {
    850872         global $wpdb, $q_config;
    851873
  • qtranslate-slug-with-widget/trunk/readme.txt

    r441989 r541230  
    11=== qTranslate slug with widget ===
    2 Contributors: 3dolab
     2Contributors: 3dolab, teonsight
    33Homepage: http://www.3dolab.net/en/qtranslateslug-plugin-widget
    44Tags: qtranslate, translation, slug, sidebar, widget, link, permalink
    55Requires at least: 2.8
    66Tested up to: 3.2.1
    7 Stable tag: 0.5
     7Stable tag: 0.6
    88
    99Multiple language slugs for qTranslate, now equipped with its own widget for language selection.
     
    2020http://www.3dolab.net/en/qtranslateslug-plugin-widget
    2121
    22 = What's new? version 0.5 (2011.09.17) =
    23 * Category slug translation implemented by Matteo Plebani: matteo@comunicrea.com
    24 * Un-tested attempt to support custom post types (including WP E-commerce products)
    25 * Un-tested attempt to remove translated slugs when a post is deleted
     22= What's new? version 0.6 (2012.05.08) =
     23* Bugfix in saving category fields (line 849)
     24* Slug translation improved by codetavern & ilpiac
    2625
    2726See the CHANGELOG for more information
     
    4241...
    4342
    44 the function qTranslateSlug_generateLanguageSelectCode() could be manually inserted wherever into the template, to use it without widget
     43the function qTranslateSlug_generateLanguageSelectCode() could be manually inserted wherever into the template, to use it without widgets
    4544
    4645
    4746== CHANGELOG ==
     47
     48= 0.6 (2012.05.08) =
     49* Bugfix in saving category fields (line 849)
     50* Slug translation improved by codetavern & ilpiac
    4851
    4952= 0.5 (2011.09.17) =
Note: See TracChangeset for help on using the changeset viewer.