Linux 软件免费装
Banner图

Text Replace

开发者 coffee2code
更新时间 2021年7月12日 13:51
捐献地址: 去捐款
PHP版本: 4.9 及以上
WordPress版本: 5.7
版权: GPLv2 or later
版权网址: 版权信息

标签

text shortcut coffee2code replace substitution

下载

1.0 2.0 2.5 3.0 3.0.2 3.1 3.1.1 3.2 3.2.1 3.2.2 3.5 3.5.1 3.6 3.6.1 3.7 3.8 3.9 3.9.1 4.0

详情介绍:

This plugin allows you to easily define text or HTML that should be used in your posts in place of words or phrases that are actually present in the posts. This is a handy technique for creating shortcuts to common, lengthy, or frequently changing text/HTML, or for smilies. Additional features of the plugin controlled both via settings and filters: A few things to keep these things in mind: ` :wp: => WordPress :aol: => America Online, Inc. ` Otherwise, you risk proper but undesired replacements: Hi => Hello Would have the effect of changing "His majesty" to "Hellos majesty". Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

安装:

  1. Whether installing or updating, whether this plugin or any other, it is always advisable to back-up your data before starting
  2. Install via the built-in WordPress plugin installer. Or install the plugin code inside the plugins directory for your site (typically /wp-content/plugins/).
  3. Activate the plugin through the 'Plugins' admin menu in WordPress
  4. Go to the Settings -> Text Replace admin options page and customize the options (notably to define the shortcuts and their replacements)
  5. Optional: Configure other plugin options as desired.
  6. Use the shortcuts in posts/pages. Shortcuts appearing in existing posts will also be affected by this plugin.

屏幕截图:

  • The admin options page for the plugin, where you define the terms/phrases/shortcuts and their related replacement text

升级注意事项:

4.0 Recommended release: added new setting to allow user-specified filters to be processed, updated plugin framework significantly, improved plugin settings page, extracted developer docs from readme into new DEVELOPER-DOCS.md, restructured unit test files, noted compatibility through WP 5.7, +more. 3.9.1 Minor update: updated a bunch of documentation, updated a few URLs to be HTTPS, improved unit testing, and noted compatibility through WP 5.4+. 3.9 Feature update: added support for Advanced Custom Fields and Elementor, added new setting to allow the plugin to run later to avoid potential conflicts with other plugins, added a number of filters, updated compatibility to be WP 4.9-5.3+, added CHANGELOG.md and TODO.md, and more. 3.8 Recommended update: fixed to honor 'replace once' setting, including for multibyte strings; allow for whitespace in text to replace to represent any number of whitespace; updated plugin framework to v048; compatibility is now WP 4.7-4.9; added README.md; more. 3.7 Minor update: improved support for localization; updated plugin framework to 042; verified compatibility through WP 4.5; dropped compatibility with WP older than 4.1; updated copyright date (2016) 3.6.1 Bugfix release: revert use of DIR constant since it isn't supported on older installations (PHP 5.2) 3.6 Recommended update: improved support of '&' in text to be replaced; added support for replacing multibyte text; updated plugin framework to version 039; noted compatibility through WP 4.1+; added plugin icon 3.5.1 Recommended minor bugfix: fix to honor case sensitivity setting when HTML is being replaced 3.5 Recommended update: fix to allow case insensitivity when HTML is being replaced; added ability to do one replacement per term per post; added unit tests; compatibility now WP 3.6-3.8+ 3.2.2 Minor bugfix release: fixed bug where special characters were being double-escaped; updated plugin framework. 3.2.1 Recommended bugfix release: fixed bug when $x (where x is a number) would not display when used in replacement string; fix to properly escape shortcut keys prior to internal use; and updated plugin framework. 3.2 Recommended update. Highlights: fixed bug with settings not appearing in MS; updated plugin framework; noted compatibility with WP 3.3+; dropped compatibility with versions of WP older than 3.1. 3.1.1 Bugfix release: fixed bug with cross-browser (mainly, IE) handling of non-wrapping textarea text; updated plugin framework; regenerated .pot file and put it into 'lang' subdirectory. 3.1 Recommended update. Highlights: updated compatibility through WP 3.2; dropped compatibility with version of WP older than 3.0; updated plugin framework, bugfix; and more. 3.0.2 Trivial update: updated plugin framework to v021; noted compatibility with WP 3.1+ and updated copyright date. 3.0 Significant and recommended update. Highlights: re-implementation; added more settings and hooks for customization; allow replacing HTML; allow case insensitivity; disable autowrap in textarea; misc improvements; verified WP 3.0 compatibility; dropped compatibility with WP older than 2.8.

常见问题:

Does this plugin modify the post content before it gets saved to the database?

No. The plugin filters post content on-the-fly as it is being output or displayed. The data saved to the database is as you typed it.

Does this plugin modify post content that already exists in the database?

No. The plugin filters post content on-the-fly as it is being output or displayed. The actual data stored in the database, whether it be pre-existing or new, is never affected by this plugin.

Will this work for posts I wrote prior to installing this plugin?

Yes, if they include strings that you've now defined as shortcuts.

What post fields get handled by this plugin?

By default, the plugin filters the post content, post excerpt, widget text, and optionally comments and comment excerpts. You can use the "More filters" setting to specify additional filters to be processed for text replacement. You can also programmatically use the 'c2c_text_replace_filters' filter to modify the affected filters (see Developer Documentation section).

How can I get text replacements to apply for post titles (or something not text-replaced by default)?

The easiest way would be to add "the_title" (or some other filter's name) as a line in the "More filters" setting. That setting allows any additional specified filters to be processed for text replacement. You can also programmatically add to the list of filters that get text replacements. See the Developer Documentation section for an example.

Is the plugin case sensitive?

By default, yes. There is a setting you can change to make it case insensitive. Or you can use the 'c2c_text_replace_case_sensitive' filter (see Developer Documentation section).

I use :wp: all the time as a shortcut for WordPress, but when I search posts for the term "WordPress", I don't see posts where I used the shortcut; why not?

Rest assured search engines will see those posts since they only ever see the posts after the shortcuts have been replaced. However, WordPress's search function searches the database directly, where only the shortcut exists, so WordPress doesn't know about the replacement text you've defined.

Will all instances of a given term be replaced in a single post?

By default, yes. There is a setting you can change so that only the first occurrence of the term in the post gets replaced. Or if you are a coder, you can use the 'c2c_text_replace_once' filter (see Developer Documentation section).

Does this plugin explicitly support any third-party plugins?

Yes. While this plugin is compatible with many other plugins that modify post and widget text, this plugin has explicit built-in support for Advanced Custom Fields and Elementor, which provide additional content areas. See documentation on the hook 'c2c_text_replace_third_party_filters' for a complete list of default supported third-party filters and how to enable compatibility with other plugins and themes. If you know the name of the filter provided by a plugin, you can add it to the "More filters" setting to have its value processed for text replacement.

Does this plugin include unit tests?

Yes.

更新日志:

4.0 (2021-07-04) Highlights: This feature release adds a new setting to allow for user-specified filters to be processed, updates the plugin framework significantly, improves the plugin settings page, extracts developer docs from readme into new DEVELOPER-DOCS.md, restructures unit test files, notes compatibility through WP 5.7, and more. Details: 3.9.1 (2020-07-11) Highlights: This minor release updates a bunch of documentation, updates a few URLs to be HTTPS, improves unit testing, and notes compatibility through WP 5.4+. Details: 3.9 (2020-01-15) Highlights: This feature release adds support for Advanced Custom Fields and Elementor, adds a new setting that can allow the plugin to run later to avoid potential conflicts with other plugins, adds a number of filters, updates compatibility to be WP 4.9-5.3+, and more. Details: Full changelog is available in CHANGELOG.md.