Title: Content Switcher
Author: Kleor
Published: <strong>2010 年 7 月 9 日</strong>
Last modified: 2025 年 9 月 9 日

---

搜索插件

![](https://ps.w.org/content-switcher/assets/icon-256x256.png?rev=3397477)

# Content Switcher

 作者：[Kleor](https://profiles.wordpress.org/kleor/)

[下载](https://downloads.wordpress.org/plugin/content-switcher.5.0.1.zip)

 * [详情](https://cn.wordpress.org/plugins/content-switcher/#description)
 * [评价](https://cn.wordpress.org/plugins/content-switcher/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/content-switcher/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/content-switcher/#developers)

 [支持](https://wordpress.org/support/plugin/content-switcher/)

## 描述

Content Switcher allows you to **easily insert** into posts, pages and widgets of
your website **random numbers, and random or variable contents**. You can use it,
for example, to display [COOKIE, ENV, GET, GLOBALS, POST, REQUEST, SERVER or SESSION](https://www.php.net/manual/en/reserved.variables.php)
variables.

 * [Documentation](https://www.kleor.com/content-switcher/)

#### Translators

 * Andrew – [WebHostingHub](https://www.webhostinghub.com) (Spanish)
 * Ogi Djuraskovic – [First Site Guide](https://firstsiteguide.com) (Serbian)

### Plugins from the same author

 * [Commerce Manager, to sell your products](https://www.kleor.com/commerce-manager/en/)
 * [Affiliation Manager, to create your affiliate program](https://www.kleor.com/affiliation-manager/en/)
 * [Membership Manager, to create your members areas](https://www.kleor.com/membership-manager/en/)
 * [Optin Manager, to build your prospects lists](https://www.kleor.com/optin-manager/en/)
 * [Contact Manager, to create your contact forms](https://www.kleor.com/contact-manager/en/)
 * [Easy Timer, to display count down/up timers](https://www.kleor.com/easy-timer/en/)
 * [Device Detect, to detect smartphones and tablets](https://www.kleor.com/device-detect/en/)

## 安装

You can install Content Switcher through the “Add Plugins” page of the “Plugins”
menu in WordPress (Plugins => Add New => Upload Plugin). Upload the plugin file 
without unzipping it. You can also install it like this:

 1. Unzip the plugin file.
 2. Upload with your FTP software the “content-switcher” folder, and only this folder,
    to your plugins directory (it should be “wp-content/plugins”).

Once you have installed Content Switcher, activate the plugin through the “Plugins”
menu in WordPress.

## 常见问题

### How can I use shortcodes in my WordPress theme?

Insert into the PHP files of your theme a code like this:

    ```
    <?php echo do_shortcode('[your-shortcode]'); ?>
    ```

### How to use shortcodes in comments?

Edit the “functions.php” file (create it if it doesn’t exist) of your WordPress 
theme and add this line of code:

    ```
    add_filter('comment_text', 'do_shortcode');
    ```

## 评价

![](https://secure.gravatar.com/avatar/816809492bd3379f1861ad03922fccb8f15ab54a0455ddab8e44965b61a9f1a3?
s=60&d=retro&r=g)

### 󠀁[Works Great](https://wordpress.org/support/topic/works-great-9511/)󠁿

 [twowithink](https://profiles.wordpress.org/twowithink/) 2025 年 2 月 18 日

Simple and convenient plugin. Thank you!

 [ 阅读所有3条评价 ](https://wordpress.org/support/plugin/content-switcher/reviews/)

## 贡献者及开发者

「Content Switcher」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ Kleor ](https://profiles.wordpress.org/kleor/)

「Content Switcher」插件已被翻译至 2 种本地化语言。 感谢[所有译者](https://translate.wordpress.org/projects/wp-plugins/content-switcher/contributors)
为本插件所做的贡献。

[帮助将「Content Switcher」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/content-switcher)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/content-switcher/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/content-switcher/)，或通过[RSS](https://plugins.trac.wordpress.org/log/content-switcher/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/content-switcher/)。

## 更新日志

 * Version 5.0.1
    - Improve the security of the “filter” attribute
 * Version 5.0
    - Remove the support for Google Analytics and Google Optimize
 * Version 4.2
    - Replace Google Optimizer with Google Optimize
 * Version 4.1.1
    - Fix a bug with PHP 8
 * Version 4.1
    - Change the tracking code of Google Analytics
 * Version 4.0.2
    - Improve the security
 * Version 4.0.1
    - Improve the security
 * Version 4.0
    - Use anonymous functions instead of “create_function”
 * Version 3.9
    - Add the ability to use custom languages
 * Version 3.8
    - Add the ability to use custom files
 * Version 3.7
    - Adapt to WordPress 4.3
 * Version 3.6.2
    - Add Serbian translation
 * Version 3.6.1
    - Improve the stability of the plugin when its folder is renamed
 * Version 3.6
    - Optimize the CSS styles of the options page for WordPress 3.8
    - Improve the uninstallation of the plugin
 * Version 3.5.3
    - Add Spanish translation
 * Version 3.5.2
    - Improve the “filter” attribute
 * Version 3.5.1
    - Improve the shortcodes
 * Version 3.5
    - Add a meta box in the edit pages of posts and pages
 * Version 3.4.1
    - Improve the installation instructions
 * Version 3.4
    - Reduce the usage of memory
    - Improve the structure of files
 * Version 3.3
    - Improve the system of global variables
    - Add the ability to use and display GLOBALS and REQUEST variables
 * Version 3.2
    - Improve the structure of files
 * Version 3.1
    - Improve the code
 * Version 3.0
    - Add Multisite support
 * Version 2.1.3
    - Add an upgrade notice
    - Factorize the code to reduce the usage of memory
 * Version 2.1.2
    - Fix a minor bug with shortcodes
 * Version 2.1.1
    - Reduce the usage of memory
 * Version 2.1
    - Reduce the usage of memory
    - Add the ability to reset the options of Content Switcher
 * Version 2.0.1
    - Minify the code
 * Version 2.0
    - Add the ability to track the back office pages with Google Analytics
    - Improve the [string] shortcode
 * Version 1.8.5
    - Minify the size of the “languages” folder
 * Version 1.8.4
    - Improve the ability to delete the options of Content Switcher
 * Version 1.8.3
    - Factorize the code of the options page
 * Version 1.8.2
    - Deactivation/reactivation is no longer necessary to add new options when Content
      Switcher is updated
    - Add the ability to display the version of Content Switcher
 * Version 1.8.1
    - Add the “default” and “filter” attributes
    - Add the ability to delete the options of Content Switcher
 * Version 1.8
    - Add the [content-switcher] shortcode
    - Minify the number of files
 * Version 1.7.7
    - Minify the size of the “initial-options.php”, “install.php” and “options-page.
      php” files
 * Version 1.7.6
    - Improve the structure of files
 * Version 1.7.5
    - Minify the code of the options page
 * Version 1.7.4
    - Optimize the performance of the options page
 * Version 1.7.3
    - Update the links to the documentation
 * Version 1.7.2
    - Add links to the options page and the documentation below the plugin’s description
    - Improve the compatibility with other shortcodes
 * Version 1.7.1
    - Improve the options page
 * Version 1.7
    - Improve the code
 * Version 1.6.2
    - Update the Google Optimizer codes
 * Version 1.6.1
    - Don’t load any JavaScript file
 * Version 1.6
    - Add the ability to use shortcodes in titles and excerpts
 * Version 1.5
    - Add the ability to add the Google Analytics code to each page of your website
    - Best factorization of the code
 * Version 1.2.1
    - Minify the code
    - Apply the “htmlspecialchars” function to GET and POST variables
 * Version 1.2
    - Add the [variable-string] shortcode
    - Add the ability to use and display COOKIE, ENV, GET, POST, SERVER and SESSION
      variables
 * Version 1.0
    - Initial version

## 额外信息

 *  版本 **5.0.1**
 *  最后更新：**9 月前**
 *  活跃安装数量 **100+**
 *  WordPress 版本 ** 3.5 或更高版本 **
 *  已测试的最高版本为 **6.8.5**
 *  PHP 版本 ** 5.3 或更高版本 **
 *  语言
 * [Dutch (Belgium)](https://nl-be.wordpress.org/plugins/content-switcher/) 、 [English (US)](https://wordpress.org/plugins/content-switcher/)
   和 [French (France)](https://fr.wordpress.org/plugins/content-switcher/).
 *  [翻译成简体中文](https://translate.wordpress.org/projects/wp-plugins/content-switcher)
 * 标签
 * [content](https://cn.wordpress.org/plugins/tags/content/)[cookie](https://cn.wordpress.org/plugins/tags/cookie/)
   [env](https://cn.wordpress.org/plugins/tags/env/)[GET](https://cn.wordpress.org/plugins/tags/get/)
   [globals](https://cn.wordpress.org/plugins/tags/globals/)
 *  [高级视图](https://cn.wordpress.org/plugins/content-switcher/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  3 条 5 星评价     ](https://wordpress.org/support/plugin/content-switcher/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/content-switcher/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/content-switcher/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/content-switcher/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/content-switcher/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/content-switcher/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/content-switcher/reviews/)

## 贡献者

 *   [ Kleor ](https://profiles.wordpress.org/kleor/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/content-switcher/)

## 捐助

您愿意支持这个插件的发展吗?

 [ 捐助此插件 ](https://www.kleor.com/donation/)