Changeset 622
- Timestamp:
- 03/07/2011 12:56:36 AM (15 months ago)
- File:
-
- 1 edited
-
trunk/WordPress/plugin/transposh/transposh.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/WordPress/plugin/transposh/transposh.php
r621 r622 166 166 add_filter('wp_redirect', array(&$this, 'on_wp_redirect'), 10, 2); 167 167 add_filter('redirect_canonical', array(&$this, 'on_redirect_canonical'), 10, 2); 168 169 // support shortcodes 170 add_shortcode('tp', array(&$this, 'tp_shortcode')); 168 171 // 169 172 // FUTURE add_action('update-custom_transposh', array(&$this, 'update')); … … 515 518 // redirect bots away from edit pages to avoid double indexing 516 519 if (transposh_utils::is_bot()) { 517 $this->tp_redirect(transposh_utils::rewrite_url_lang_param($_SERVER["REQUEST_URI"], $this->home_url, $this->enable_permalinks_rewrite, transposh_utils::get_language_from_url($_SERVER["REQUEST_URI"], $this->home_url), false) ); //."&stop=y");520 $this->tp_redirect(transposh_utils::rewrite_url_lang_param($_SERVER["REQUEST_URI"], $this->home_url, $this->enable_permalinks_rewrite, transposh_utils::get_language_from_url($_SERVER["REQUEST_URI"], $this->home_url), false), 301); 518 521 exit; 519 522 } … … 1094 1097 } 1095 1098 1099 /** 1100 * Support for tp shortcodes - [tp] 1101 * @see http://trac.transposh.org/wiki/ShortCodes 1102 * @param array $atts 1103 * @param string $content 1104 * @return string 1105 */ 1106 function tp_shortcode($atts, $content = null) { 1107 $only_class = ''; 1108 $lang = ''; 1109 $nt_class = ''; 1110 1111 if (isset($atts['not_in'])) { 1112 if (stripos($atts['not_in'], $this->target_language) !== false) { 1113 return; 1114 } 1115 } 1116 1117 if (isset($atts['lang'])) { 1118 $lang = ' lang="' . $atts['lang'] . '"'; 1119 } 1120 1121 if (isset($atts['only'])) { 1122 $only_class = ' class="' . ONLY_THISLANGUAGE_CLASS . '"'; 1123 } 1124 1125 if (isset($atts['no_translate'])) { 1126 $nt_class = ' class="' . NO_TRANSLATE_CLASS . '"'; 1127 } 1128 1129 if ($lang || $only_class || $nt_class) { 1130 return '<span '.$only_class.$nt_class.$lang.'>' . do_shortcode($content) . '</span>'; 1131 } else { 1132 return do_shortcode($content); 1133 } 1134 } 1135 1096 1136 } 1097 1137
Note: See TracChangeset
for help on using the changeset viewer.
