WordPress.org

Plugin Directory

Changeset 628789


Ignore:
Timestamp:
11/22/12 19:59:26 (17 months ago)
Author:
Chouby
Message:

bug correction

Location:
polylang/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • polylang/trunk/include/admin-filters.php

    r627893 r628789  
    6868 
    6969            // adds actions related to languages when creating, saving or deleting media 
    70             add_filter('attachment_fields_to_save', array(&$this, 'save_media')); 
     70            add_filter('attachment_fields_to_save', array(&$this, 'save_media'), 10, 2); 
    7171            add_action('delete_attachment', array(&$this, 'delete_post')); 
    7272            add_filter('wp_delete_file', array(&$this, 'wp_delete_file')); 
     
    232232    // adds the Language box in the 'Edit Post' and 'Edit Page' panels (as well as in custom post types panels) 
    233233    function add_meta_boxes($post_type) { 
    234         if (in_array($post_type, $this->post_types)) 
     234        if (in_array($post_type, array_diff($this->post_types, array('attachment')))) 
    235235            add_meta_box('ml_box', __('Languages','polylang'), array(&$this,'post_language'), $post_type, 'side', 'high'); 
    236236 
     
    542542    // adds the language field and translations tables in the 'Edit Media' panel 
    543543    function attachment_fields_to_edit($fields, $post) { 
    544         $screen = get_current_screen(); 
    545544        $post_id = $post->ID; 
    546545        $lang = $this->get_post_language($post_id); 
     
    561560 
    562561        // don't show translations except on edit media panel 
    563         if ($screen->base == 'media') { 
     562        // media.php for WP < 3.5 and post.php since WP 3.5 
     563        if (in_array($GLOBALS['pagenow'], array('media.php', 'post.php'))) { 
    564564        if ($lang) { 
    565565                ob_start(); 
     
    580580 
    581581    // ajax response for changing the language in media form 
     582    // FIXME: js not written!!! 
    582583    function media_lang_choice() { 
    583584        preg_match('#([0-9]+)#', $_POST['post_id'], $matches); 
     
    627628 
    628629    // called when a media is saved 
    629     // the language is automatically saved by WP 
    630     function save_media($post) { 
     630    function save_media($post, $attachment) { 
     631        $this->set_post_language($post['ID'], $attachment['language']); // the language is no more automatically saved by WP since WP 3.5  
     632 
    631633        $this->delete_translation('post', $post['ID']); 
    632634 
  • polylang/trunk/include/api.php

    r624201 r628789  
    44function pll_the_languages($args = '') { 
    55    global $polylang; 
    6     return isset($polylang) ? $polylang->the_languages($args) : ''; 
     6    return class_exists('Polylang_Core') && $polylang instanceof Polylang_Core ? $polylang->the_languages($args) : ''; 
    77} 
    88 
     
    1010function pll_current_language($args = 'slug') { 
    1111    global $polylang; 
    12     return isset($polylang) ? $polylang->current_language($args) : false; 
     12    return class_exists('Polylang_Core') && $polylang instanceof Polylang_Core ? $polylang->current_language($args) : false; 
    1313} 
    1414 
     
    2828function pll_home_url() { 
    2929    global $polylang; 
    30     return isset($polylang) ? $polylang->get_home_url() : home_url('/'); 
     30    return class_exists('Polylang_Core') && $polylang instanceof Polylang_Core ? $polylang->get_home_url() : home_url('/'); 
    3131} 
    3232 
  • polylang/trunk/include/core.php

    r627893 r628789  
    7777 
    7878        // redirects incoming links to the proper URL when adding the language code to all urls 
    79         if ($this->options['force_lang'] && get_option('permalink_structure') && PLL_LANG_EARLY) 
    80             add_action('template_redirect',  array(&$this, 'redirect_canonical'), 20); // after Wordpress redirect_canonical 
     79// FIXME causes a lot of issues 
     80//      if ($this->options['force_lang'] && get_option('permalink_structure') && PLL_LANG_EARLY) 
     81//          add_action('template_redirect',  array(&$this, 'redirect_canonical'), 20); // after Wordpress redirect_canonical 
    8182 
    8283        // adds javascript at the end of the document 
  • polylang/trunk/polylang.php

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

    r627893 r628789  
    9898* It is now possible to query the terms by language using the WordPress function 'get_terms' 
    9999* Bug correction: search for empty string in default language displays posts in all languages when hiding the URL language information for default language  
    100 * Tests done with WordPress 3.5 beta 3 
     100* Bug correction: removed the canonical redirection introduced in 0.9.5 which creates more problems than it solves 
     101* Tests done with WordPress 3.5 beta RC1 
    101102 
    102103= 0.9.5 (2012-11-13) = 
Note: See TracChangeset for help on using the changeset viewer.