Changeset 780


Ignore:
Timestamp:
02/17/13 02:25:22 (21 months ago)
Author:
ofer
Message:

Fix the bug reported by dserber disallowing language selection on post where translate_on_publish was disabled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/WordPress/plugin/transposh/wp/transposh_postpublish.php

    r753 r780  
    3434    function transposh_postpublish(&$transposh) { 
    3535        $this->transposh = &$transposh; 
    36         // we'll only do something if so configured to do 
    37         if ($this->transposh->options->enable_autoposttranslate) { 
    38             add_action('edit_post', array(&$this, 'on_edit')); 
    39         } 
     36        // we need this anyway because of the change language selection 
     37        add_action('edit_post', array(&$this, 'on_edit')); 
    4038        add_action('admin_menu', array(&$this, 'on_admin_menu')); 
    4139    } 
     
    216214    function on_edit($postID) { 
    217215        // TODO - CHECK if (!isset($_POST['transposh_tp_language'])) return; 
    218         add_post_meta($postID, 'transposh_can_translate', 'true', true); 
     216        if ($this->transposh->options->enable_autoposttranslate) { 
     217            add_post_meta($postID, 'transposh_can_translate', 'true', true); 
     218        } 
    219219        if ($_POST['transposh_tp_language'] == '') { 
    220220            delete_post_meta($postID, 'tp_language'); 
Note: See TracChangeset for help on using the changeset viewer.