Changeset 490


Ignore:
Timestamp:
08/07/2010 08:56:05 PM (18 months ago)
Author:
ofer
Message:

Fix the content of a post

File:
1 edited

Legend:

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

    r489 r490  
    140140 
    141141        // full post wrapping (should happen late) 
    142         add_filter('the_content', array(&$this, 'post_wrap'), 9999); 
     142        add_filter('the_content', array(&$this, 'post_content_wrap'), 9999); 
    143143        add_filter('the_title', array(&$this, 'post_wrap'), 9999, 2); 
    144144        // allow to mark the language? 
     
    757757 
    758758    /** 
    759      * Modify posts and posts title to have language wrapping 
     759     * Modify posts to have language wrapping 
    760760     * @global int $id the post id 
    761761     * @param string $text the post text (or title text) 
     762     * @return string wrapped text 
     763     */ 
     764    function post_content_wrap($text) { 
     765        $lang = get_post_meta($GLOBALS['id'], 'tp_language', true); 
     766        if ($lang) { 
     767            $text = "<span lang =\"$lang\">" . $text . "</span>"; 
     768        } 
     769        return $text; 
     770    } 
     771 
     772    /** 
     773     * Modify post title to have language wrapping 
     774     * @param string $text the post title text 
    762775     * @return string wrapped text 
    763776     */ 
Note: See TracChangeset for help on using the changeset viewer.