WordPress.org

Plugin Directory

Changeset 356883


Ignore:
Timestamp:
03/07/11 20:19:54 (3 years ago)
Author:
leogermani
Message:

[fix] meta box other translations

Location:
multi-language-framework/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • multi-language-framework/trunk/css/style.css

    r298092 r356883  
    194194    border-top: none; 
    195195} 
     196 
     197.translation_div { 
     198    overflow: hidden; 
     199} 
  • multi-language-framework/trunk/post_types.php

    r356875 r356883  
    137137     
    138138        add_meta_box( 'post_translations',__('Post Translations', 'mlf'), 'post_translation_inner_box', $p, 'side' ); 
     139        add_meta_box( 'mlf_other_version_id',__('Post Translations', 'mlf'),'mlf_other_versions_box', $p, 'normal', 'high' ); 
    139140         
    140141        foreach ($enabled_languages as $lang) { 
    141142            add_meta_box( 'post_translations',__('Post Translations', 'mlf'),'post_translation_inner_box', $p . '_translations_' . $lang, 'side' ); 
     143            add_meta_box( 'mlf_other_version_id',__('Post Translations', 'mlf'),'mlf_other_versions_box', $p . '_translations_' . $lang, 'normal', 'high' ); 
    142144        } 
    143145     
     
    310312} 
    311313 
    312 add_action('admin_menu', 'mlf_other_versions_add_box'); 
    313  
    314 function mlf_other_versions_add_box() { 
    315     $enabled_languages = mlf_get_option('enabled_languages'); 
    316  
    317     add_meta_box( 'mlf_other_version_id',__('Post Translations', 'mlf'),'mlf_other_versions_box', 'post', 'normal', 'high' ); 
    318  
    319     foreach ($enabled_languages as $lang) { 
    320         add_meta_box( 'mlf_other_version_id',__('Post Translations', 'mlf'),'mlf_other_versions_box', 'post_translations_' . $lang, 'normal', 'high' ); 
    321     } 
    322  
    323 } 
    324  
    325314function mlf_other_versions_box(){ 
    326315    global $post; 
     
    340329            $posts->the_post(); 
    341330             
    342             if ($post->post_type == 'post'){ 
     331            if (preg_match('/^\S+_translations_(\S{2})$/', $post->post_type)) 
     332                $lang = preg_replace('/^\S+_translations_(\S{2})$/', "$1", $post->post_type); 
     333            else 
    343334                $lang = $default_language; 
    344             }else{ 
    345                 $lang = substr($post->post_type,-2,2);     
    346             } 
    347              
     335                 
    348336            $translation_version[$lang] = '<h2>' . get_the_title() . '</h2>' . get_the_content(); 
    349337        } 
Note: See TracChangeset for help on using the changeset viewer.