WordPress.org

Plugin Directory

Changeset 634506


Ignore:
Timestamp:
12/05/12 19:47:31 (17 months ago)
Author:
Chouby
Message:

bug corrections

Location:
polylang/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • polylang/trunk/include/core.php

    r631999 r634506  
    4242        add_action('init', array(&$this, 'init')); 
    4343        foreach (array('wp', 'login_init', 'admin_init') as $filter) // admin_init for ajax thanks to g100g 
    44             add_action($filter, array(&$this, 'load_textdomains'), 5); // priority 5 for post types and taxonomies with registered with in wp hook with default priority 
     44            add_action($filter, array(&$this, 'load_textdomains'), 5); // priority 5 for post types and taxonomies registered in wp hook with default priority 
    4545 
    4646        // filters the WordPress locale 
     
    226226    // sets the language when it is always included in the url 
    227227    function setup_theme() { 
     228        // special case for ajax request 
     229        if (isset($_REQUEST['pll_load_front'])) { 
     230            $this->curlang = isset($_REQUEST['lang']) && $_REQUEST['lang'] ? $this->get_language($_REQUEST['lang']) : $this->get_preferred_language(); 
     231            do_action('pll_language_defined'); 
     232            return; 
     233        } 
     234 
    228235        $root = $this->options['rewrite']? '' : 'language/'; 
    229236 
     
    809816 
    810817    // translates page for posts and page on front 
    811     function translate_page($val) { 
     818    function translate_page($v) { 
    812819        // returns the current page if there is no translation to avoid ugly notices 
    813820        // the fonction is often called so let's store the result 
    814         return isset($this->curlang) && $val && (isset($this->posts[$val]) || $this->posts[$val] = $this->get_post($val, $this->curlang)) ? $this->posts[$val] : $val; 
     821        return isset($this->curlang) && $v && (isset($this->posts[$v]) || $this->posts[$v] = $this->get_post($v, $this->curlang)) ? $this->posts[$v] : $v; 
    815822    } 
    816823 
     
    821828 
    822829        $theme = get_theme_root(); 
    823         foreach (debug_backtrace(/*!DEBUG_BACKTRACE_PROVIDE_OBJECT|DEBUG_BACKTRACE_IGNORE_ARGS*/) as $trace) { 
     830        foreach (array_reverse(debug_backtrace(/*!DEBUG_BACKTRACE_PROVIDE_OBJECT|DEBUG_BACKTRACE_IGNORE_ARGS*/)) as $trace) { 
    824831            // search form 
    825832            if (isset($trace['file']) && strpos($trace['file'], 'searchform.php')) 
    826833                return $GLOBALS['wp_rewrite']->using_permalinks() ? $this->get_home_url($this->curlang, true) : $url; 
     834 
     835            // don't interfere with get_search_form filter which I prefer to use when possible 
     836            if ($trace['function'] == 'get_search_form') 
     837                return $url; 
    827838 
    828839            $ok = $trace['function'] == 'wp_nav_menu' || 
  • polylang/trunk/polylang.php

    r634162 r634506  
    33Plugin Name: Polylang 
    44Plugin URI: http://wordpress.org/extend/plugins/polylang/ 
    5 Version: 0.9.7 
     5Version: 0.9.7.1 
    66Author: F. Demarle 
    77Description: Adds multilingual capability to Wordpress 
     
    2727*/ 
    2828 
    29 define('POLYLANG_VERSION', '0.9.7'); 
     29define('POLYLANG_VERSION', '0.9.7.1'); 
    3030define('PLL_MIN_WP_VERSION', '3.1'); 
    3131 
  • polylang/trunk/readme.txt

    r634162 r634506  
    9393 
    9494== Changelog == 
     95 
     96= 0.9.8 = 
     97 
     98* Bug correction: ajax on frontend does not work when adding the language code to all urls 
     99* Bug correction: search forms using the get_search_form filter do not work 
    95100 
    96101= 0.9.7 (2012-12-04) = 
Note: See TracChangeset for help on using the changeset viewer.