Don't like ads? PRO users don't see any ads ;-)

wp-print with qtranslate WordPress

By: pifa on May 8th, 2012  |  syntax: PHP  |  size: 1.45 KB  |  hits: 32  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ### Function: Print htaccess ReWrite Rules
  2. add_filter('generate_rewrite_rules', 'print_rewrite');
  3. function print_rewrite($wp_rewrite) {
  4.    // Print Rules For Posts
  5.    $r_rule = '';
  6.    $r_link = '';
  7.    $print_link = qtrans_convertURL(get_permalink());
  8.  
  9.  
  10. ### Function: Display Print Link
  11. function print_link($print_post_text = '', $print_page_text = '', $echo = true) {
  12.    global $id;
  13.    if (function_exists('polyglot_get_lang')){
  14.        global $polyglot_settings;
  15.        $polyglot_append = $polyglot_settings['uri_helpers']['lang_view'].'/'.polyglot_get_lang().'/';
  16.    }
  17.    $output = '';
  18.    $using_permalink = get_option('permalink_structure');
  19.    $print_options = get_option('print_options');
  20.    $print_style = intval($print_options['print_style']);
  21.    if(empty($print_post_text)) {
  22.       $print_text = stripslashes($print_options['post_text']);
  23.    } else {
  24.       $print_text  = $print_post_text;
  25.    }
  26.    $print_icon = plugins_url('wp-print/images/'.$print_options['print_icon']);
  27.    $print_link = qtrans_convertURL(get_permalink());
  28.    $print_html = stripslashes($print_options['print_html']);
  29.    // Fix For Static Page
  30.    if(get_option('show_on_front') == 'page' && is_page()) {  
  31.       if(intval(get_option('page_on_front')) > 0) {
  32.          $print_link = qtrans_convertURL(_get_page_link());
  33.       }
  34.    }
  35.  
  36. //I am using wp-print with qtranslate and this is the code changes I made to wp-print.php See where I put the qtrans_convertURL in the script.