css - 如何从 Transposh 中删除 'Edit Translation' 文本

标签 css wordpress

我正在尝试从 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 . '\';"/>&nbsp;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">&nbsp;Edit Translation</p>';
}

我只是在其中添加了一个类名为 edittranslationtext 的 p 元素。在您的自定义 CSS 中,您现在可以添加:

.edittranslationtext {
  display: none;
}

关于css - 如何从 Transposh 中删除 'Edit Translation' 文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39783090/

相关文章:

wordpress 站点中事件菜单项上的 CSS

css - 如何使 iFrame 随背景滚动?

html - Ionic ionic 重新排序按钮中断设计

javascript - 如何根据数据表中的单元格值更改行的背景颜色?

loops - 限制从 WP_Query 或 'get' 函数返回的 wordpress 字段

wordpress - 如何在 Google Compute Engine 中安装我的 Comodo SSL 证书?

css - 添加评论时,WordPress 侧边栏会下降到页面底部

php - WordPress 侧边栏菜单不适用于 CSS

html - 用不同的样式格式化不同的输入

css - How to fix the container takes the::after 样式