我正在尝试从 Transposh 中删除“编辑翻译”文本。我将按原样保留翻译。
我正在尝试像这样添加 css:
#transposh-3:nth-child(8){display:none;}
和
localizertextnode{display:none;}
但他们似乎没有工作。有什么想法吗?
我知道这更多地与 WordPress 有关,但我正在尝试使用 CSS 来解决这个问题,这是一种编码语言,所以我认为这可能只是符合标准。
此外,overflow 上的流量比 WordPress 上的流量多得多。
最佳答案
我知道这是一个很晚的答案,但我偶然发现了同样的问题。也许它可以在将来帮助其他人。
在插件的源文件中,编辑下一个文件: wp-content/plugins/transposh-translation-filter-for-wordpress/wp/transposh_widget.php
在第 301-306 行编辑以下代码
if ($this->transposh->is_editing_permitted()) {
$ref = transposh_utils::rewrite_url_lang_param($_SERVER["REQUEST_URI"], $this->transposh->home_url, $this->transposh->enable_permalinks_rewrite, ($this->transposh->options->is_default_language($this->transposh->target_language) ? "" : $this->transposh->target_language), !$this->transposh->edit_mode);
echo '<input type="checkbox" name="' . EDIT_PARAM . '" value="1" ' .
($this->transposh->edit_mode ? 'checked="checked" ' : '') .
' onclick="document.location.href=\'' . $ref . '\';"/> Edit Translation';
}
并将其更改为
if ($this->transposh->is_editing_permitted()) {
$ref = transposh_utils::rewrite_url_lang_param($_SERVER["REQUEST_URI"], $this->transposh->home_url, $this->transposh->enable_permalinks_rewrite, ($this->transposh->options->is_default_language($this->transposh->target_language) ? "" : $this->transposh->target_language), !$this->transposh->edit_mode);
echo '<input type="checkbox" name="' . EDIT_PARAM . '" value="1" ' .
($this->transposh->edit_mode ? 'checked="checked" ' : '') .
' onclick="document.location.href=\'' . $ref . '\';"/><p class="edittranslationtext"> Edit Translation</p>';
}
我只是在其中添加了一个类名为 edittranslationtext 的 p 元素。在您的自定义 CSS 中,您现在可以添加:
.edittranslationtext {
display: none;
}
关于css - 如何从 Transposh 中删除 'Edit Translation' 文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39783090/