Title: CMC Hook
Author: Edem
Published: <strong>2017 年 4 月 26 日</strong>
Last modified: 2017 年 7 月 24 日

---

搜尋外掛

![](https://ps.w.org/cmc-hook/assets/banner-772x250.JPG?rev=1648063)

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/cmc-hook_fffdff.svg)

# CMC Hook

 由 [Edem](https://profiles.wordpress.org/lovnic/) 開發

[下載](https://downloads.wordpress.org/plugin/cmc-hook.1.0.6.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/cmc-hook/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/cmc-hook/#reviews)
 * [開發資訊](https://tw.wordpress.org/plugins/cmc-hook/#developers)

 [技術支援](https://wordpress.org/support/plugin/cmc-hook/)

## 外掛說明

a. Targeted at developers for quick test and development of plugins
 a. Register
php functions to hooks ( action and filter ) live from wordpress dashboard tools.
b. Run php, html, css and javascript codes safely. php codes are enclosed between
php tags eg. “” c. Hooks can be disabled from the url, so your system can recover
from erroneous php codes d. create and quickly live test plugins from your website
before deployment e. Easy to use with shortcodes f. Very extendable with other plugins
as it has lots of filters and actions.

### shortcode

[cmchksh id=”” slug=””]

## 螢幕擷圖

 * [[
 * Hooks
 * [[
 * Hook – Filter
 * [[
 * Hook – Action
 * [[
 * Hook – File
 * [[
 * Projects
 * [[
 * Project Hooks
 * [[
 * Settings

## 常見問題集

  Minimum Requirements

wordpress 4.6.0
 php 5.5

  How to install

Upload the plugin to the wp-content\plugins folder of your wordpress installaiton
and activate it

  How to use

The plugin create a sub menu to tools admin menu called “cmc hook”
 From the cmc
hook menu you can create hooks which can be either a filter, action or file The 
code editor of filter and action should not contain any class or function definition
as they are run in annonymous functions File hooks can have class and function definition.

  In case there are php errors which hangs my site

You can deactivate hooks from url and even prevent all hooks from loading.

  How To Deactivate hook

To deactivate hook, pass “cmchk_neg=cmchkrtk&cmchk_id=2,3” to the url. The cmchk_id
is the id of the list of hooks you want to deactivate
 Add “cmchk_run_on=none” to
the url parameters to prevents all hooks from loading and running. “cmchk_neg=token”
must be present in the url parameters when deactivating any hook or project. The
value of which is a security token which defaults to “cmchkrtk” and can be changed
at the settings of “cmc hook” menu

  What are Hook Projects

From the cmc hook menu projects can be created which houses a list of hooks and 
can be exported as a wordpress plugin
 Projects have one main “run file” that runs
when the project is loaded. This file calls all other project hooks. To include 
other project file hook use “cmchk_include( ‘slug’ )” function. The id is the slug
of the hook file to load Projects action and filters are loaded automatically when
the project loads and must not be included in the run file.

  Can I Deactivate Projects

Projects can be deactivated remotely by adding to the url parameters “cmchk_pid=
4,5” where cmchk is the id of the projects to deactivate

  What is safe mode

Hooks can also be run in safe mode. This allows hooks to only run when “cmchk_safe
=id” is appended to the url parameters. The id is the id of hook

  Can I choose not to use codemirror

Codemirror is provided as the coded editor but can be disabled at the settings to
use plain textarea

  Should i use php tags

Php codes must be code tags eg. “”. The same apply to javascript and css.

  Can I use html javascript and css in the code editor

A misture of html, php, javascript and css can be used in the code editor

  Filters

cmchk_load_hook
 cmchk_load_project cmchk_editor_data_save cmchk_project_editor_data_save
cmchk_settings_data_save cmchk_export_projects cmchk_import_project cmchk_export_plugin_info
cmchk_update_slug cmchk_get_slug cmchk_admin_page_menu cmchk_admin_page_section 
cmchk_create_plugin_hooks cmchk_create_plugin_file_hooks cmchk_include_hook

  Actions

cmchk_hook_loaded
 cmchk_editor_save cmchk_project_editor_save cmchk_settings_save
cmchk_admin_page_settings_controls cmchk_admin_page_hook_editor_wp_funcs cmchk_admin_page_editor_controls_top
cmchk_admin_page_editor_controls cmchk_admin_page_project_editor_controls cmchk_admin_page_project_editor_controls2

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈CMC Hook〉的開發相關工作。

參與者

 *   [ Edem ](https://profiles.wordpress.org/lovnic/)

[將〈CMC Hook〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/cmc-hook)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/cmc-hook/)、查看
[SVN 存放庫](https://plugins.svn.wordpress.org/cmc-hook/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/cmc-hook/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/cmc-hook/)。

## 中繼資料

 *  版本 **1.0.6**
 *  最後更新 **9 年前**
 *  啟用安裝數 **少於 10 次**
 *  WordPress 版本需求 ** 4.6.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **4.8.28**
 *  語言
 * [English (US)](https://wordpress.org/plugins/cmc-hook/)
 * 標籤
 * [css](https://tw.wordpress.org/plugins/tags/css/)[javascript](https://tw.wordpress.org/plugins/tags/javascript/)
   [php](https://tw.wordpress.org/plugins/tags/php/)[shortcode generator](https://tw.wordpress.org/plugins/tags/shortcode-generator/)
 *  [進階檢視](https://tw.wordpress.org/plugins/cmc-hook/advanced/)

## 評分

這個項目尚無任何評論記錄。

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

[查看全部使用者評論](https://wordpress.org/support/plugin/cmc-hook/reviews/)

## 參與者

 *   [ Edem ](https://profiles.wordpress.org/lovnic/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/cmc-hook/)