前言介紹
- 這款 WordPress 外掛「Text Modules」是 2015-07-23 上架。
- 目前有 50 個安裝啟用數。
- 上一次更新是 2015-08-20,距離現在已有 3545 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0.0 以上版本才可以安裝。
- 有 1 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
post | text | module | modules | custom post type |
內容簡介
使用新的「Text Modules」自訂文章類型,透過簡碼或小工具(widget)顯示文字模組。
有沒有試過想要多次使用某些文字資訊?例如聯絡資訊,如郵寄地址?或一些口號、座右銘或標語?
這正是「Text Modules」發揮作用的時機。
用法
這個外掛程式為文字模組登記了一個簡單的自訂文章類型。透過簡碼(shortcode,這裡是指使用文字模組的 ID 或輸入名稱)或透過一個新的「Text Modules」小工具來存取文字模組。
篩選器
為了自訂外掛程式的某些方面,它提供了幾個篩選器。針對每個篩選器,以下提供了簡短的說明和代碼範例,以調整預設行為的方式。只需將相應的程式碼片段放入您的佈景主題的functions.php文件,您的自定義外掛程式,或其他合適的地方即可。
text_modules_after_widget_content
此篩選器允許您在小工具內容之後更改 HTML。
/**
* 篩選器小工具內容後的 HTML。
*
* @param string $after_widget_content 小工具內容後的某些 HTML。
*/
add_filter( 'text_modules_after_widget_content', function() {
return '';
} );
text_modules_before_widget_content
此篩選器允許您在小工具內容之前更改 HTML。
/**
* 篩選器小工具內容之前的 HTML。
*
* @param string $before_widget_content 小工具內容之前的某些 HTML。
*/
add_filter( 'text_modules_before_widget_content', function() {
return '';
} );
text_modules_post_type
是的,您可以修改自訂的文章類型(輸入名稱)。
/**
* 篩選文章類型。
*
* @param string $post_type 文章類型。
*/
add_filter( 'text_modules_post_type', function() {
return 'exotic_stuff';
} );
text_modules_post_type_args
如果您想要修改特定的文章類型參數,但無法找到合適的篩選器,那麼可以使用 text_modules_post_type_args,它提供了完整的 args 陣列。
/**
* 篩選文章類型 args。
*
* @param array $args 文章類型 args。
*/
add_filter( 'text_modules_post_type_args', function( $args ) {
// 使用階層式外部內容
$args[ 'hierarchical' ] = TRUE;
return $args;
} );
text_modules_post_type_description
文章類型描述可以透過使用 text_modules_post_type_description 篩選器自訂。
/**
* 篩選文章類型描述。
*
* @param string $description 文章類型描述。
*/
add_filter( 'text_modules_post_type_description', function() {
// 提供一個說明
return '用於文字模組的簡單自訂文章類型。';
} );
text_modules_post_type_labels
如果您不喜歡標籤,可以輕鬆地將它們調整到您喜歡的樣子。
/**
* 篩選文章類型標籤。
*
* @param array $labels 文章類型標籤。
*/
add_filter( 'text_modules_post_type_labels', function( $labels ) {
// 請再多點可怕的東西...
$labels[ 'not_found' ] = 'ZOMG,找不到文字模組了!!1!!1!!oneone!!1!eleven!1!';
return $labels;
} );
text
原文外掛簡介
Use the new Text Modules custom post type and display a text module by either shortcode or widget.
Have you ever wanted to use some pieces of text information more than once? For instance, contact information such as a postal address? Or some slogan, motto or claim?
This is exactly when Text Modules kicks in.
Usage
This plugin registers a simple post type for text modules. A text module can be accessed either via shortcode (by means of the text module’s ID or slug) or via a new Tex Modules widget.
Filters
In order to customize certain aspects of the plugin, it provides you with several filters. For each of these, a short description as well as a code example on how to alter the default behavior is given below. Just put the according code snippet in your theme’s functions.php file or your customization plugin, or to some other appropriate place.
text_modules_after_widget_content
This filter lets you alter the HTML after the widget content.
/**
* Filter the HTML after the widget content.
*
* @param string $after_widget_content Some HTML after the widget content.
*/
add_filter( 'text_modules_after_widget_content', function() {
return '';
} );
text_modules_before_widget_content
This filter lets you alter the HTML before the widget content.
/**
* Filter the HTML before the widget content.
*
* @param string $before_widget_content Some HTML before the widget content.
*/
add_filter( 'text_modules_before_widget_content', function() {
return '';
} );
text_modules_post_type
Yes, you can alter the post type (slug).
/**
* Filter the post type.
*
* @param string $post_type Post type.
*/
add_filter( 'text_modules_post_type', function() {
return 'exotic_stuff';
} );
text_modules_post_type_args
If you want to alter a specific post type argument but you can’t find a fitting filter, there’s text_modules_post_type_args, which provides you with the complete args array.
/**
* Filter the post type args.
*
* @param array $args Post type args.
*/
add_filter( 'text_modules_post_type_args', function( $args ) {
// Use hierarchical external content
$args[ 'hierarchical' ] = TRUE;
return $args;
} );
text_modules_post_type_description
The post type description can be customized by using the text_modules_post_type_description filter.
/**
* Filter the post type description.
*
* @param string $description Post type description.
*/
add_filter( 'text_modules_post_type_description', function() {
// Provide a description
return 'Simple post type for text modules.';
} );
text_modules_post_type_labels
In case you don’t like the labels, easily adapt them to your liking.
/**
* Filter the post type labels.
*
* @param array $labels Post type labels.
*/
add_filter( 'text_modules_post_type_labels', function( $labels ) {
// A little more horror, please...
$labels[ 'not_found' ] = 'ZOMG, no text module found!!1!!1!!oneone!!!1!eleven!1!';
return $labels;
} );
text_modules_post_type_supports
This filter provides you with the post type supports.
/**
* Filter the post type supports.
*
* @param array $supports Post type supports.
*/
add_filter( 'text_modules_post_type_supports', function( $supports ) {
// Let's add revisions for our post type
if ( ! in_array( 'revisions', $supports ) ) {
$supports[] = 'revisions';
}
return $supports;
} );
text_modules_shortcode_apply_do_shortcode
By default, do_shortcode() will be called on the shortcode output. Of course, you can change that.
/**
* Filter if the shortcode should apply do_shortcode() to the output.
*
* @param bool $do_shortcode Should the shortcode apply do_shortcode()?
*/
add_filter( 'text_modules_shortcode_apply_do_shortcode', '__return_false' );
text_modules_shortcode_callback
In case you would like to adapt how the shortcode data is handled, you can provide your own shortcode callback. This can either be a string holding the function name, or an array with either a class name or an object, and the according method.
/**
* Filter the shortcode callback.
*
* @param array|string $callback Shortcode callback.
*/
add_filter( 'text_modules_shortcode_callback', function() {
return 'my_text_modules_shortcode_callback';
} );
text_modules_shortcode_id_attribute_name
This filter lets you alter the shortcode’s ‘id’ attribute name.
/**
* Filter the 'id' shortcode attribute name.
*
* @param string $name Attribute name.
*/
add_filter( 'text_modules_shortcode_id_attribute_name', function() {
return 'post_id';
} );
text_modules_shortcode_output
This filter lets you alter the shortcode output. The second parameter holds the shortcode attributes array.
/**
* Filter the shortcode output.
*
* @param string $output Shortcode output.
* @param array $atts Shortcode attributes array.
*/
add_filter( 'text_modules_shortcode_output', function( $output ) {
return $output . ' Over and out.';
} );
text_modules_shortcode_query_args
Also, there’s text_modules_shortcode_query_args, which provides you with the complete args array for the shortcode’s query.
/**
* Filter the shortcode query args.
*
* @param array $args Shortcode query args.
*/
add_filter( 'text_modules_shortcode_query_args', function( $args ) {
// Exclude some text modules by ID
$args[ 'post__not_in' ] = array( 4, 8, 15, 16, 23, 42 );
return $args;
} );
text_modules_shortcode_slug_attribute_name
This filter lets you alter the shortcode’s ‘slug’ attribute name.
/**
* Filter the 'slug' shortcode attribute name.
*
* @param string $name Attribute name.
*/
add_filter( 'text_modules_shortcode_slug_attribute_name', function() {
return 'post_slug';
} );
text_modules_shortcode_tag
This filter lets you alter the shortcode’s tag.
/**
* Filter the shortcode tag.
*
* @param string $shortcode_tag Shortcode tag.
*/
add_filter( 'text_modules_shortcode_tag', function() {
return 'text_block';
} );
text_modules_shortcode_use_slug
By default, text modules are being queried by their post ID first. Of course, you can change that and use the post slug instead.
/**
* Filter if the shortcode (query) should use the post slug instead of the post ID.
*
* @param bool $use_slug Use slug instead of ID?
*/
add_filter( 'text_modules_shortcode_use_slug', '__return_true' );
text_modules_widget_form_query_args
Also, there’s text_modules_widget_form_query_args, which provides you with the complete args array for the widget form’s query.
/**
* Filter the widget form query args.
*
* @param array $args Query args.
*/
add_filter( 'text_modules_widget_form_query_args', function( $args ) {
// Exclude some text modules by ID
$args[ 'post__not_in' ] = array( 4, 8, 15, 16, 23, 42 );
return $args;
} );
Contribution
To contribute to this plugin, please see its GitHub repository.
If you have a feature request, or if you have developed the feature already, please feel free to use the Issues and/or Pull Requests section.
Of course, you can also provide me with translations if you would like to use the plugin in another not yet included language.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Text Modules」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Module Extender For Divi 》The Module Extender For Divi配合Elegant Themes的Divi Page Builder工作。 只需將模塊zip文件添加到子佈題的模塊文件夾中。 然後,這些額外的模塊將會在Div...。
Events Calendar Modules for Divi 》**事件日曆 Divi 模組是一個功能豐富、易於使用的外掛,可以讓您在 Divi 電腦版本的網站上以精美的設計佈局顯示來自事件日曆外掛的活動。無論您是想要簡約的...。
Twispay Credit Card Payments 》注意:如果您在整合過程中遇到任何困難,請聯繫我們的支援團隊 [email protected],我們將協助您完成整個過程。, Twispay是一家歐洲認證的收賬銀行,擁有為...。
myCred for Courseware 》Courseware 允許您創建課程、模組、課程單元和相應的內容,也可以加入檢測或問卷等功能。使用 [shortcodes] 或小工具進行拖放以排列課程,建立課程大綱。課程...。
Module Positions 》這個外掛可以做什麼?, 如果你的網站有多個子頁面,你可能會想在模板中處理一些特定的內容(比如側邊欄、頁腳、橫幅等等)。 WordPress 小工具可以在特定的小...。
Location Module (Lite) for Contact Form 7 》這個「聯絡表單 7」的 Location Module 具有讓使用者搜尋其位置、調整和發送位置的擴充功能。它會顯示一個地址表單和一張地圖(使用 Google 地圖)。使用者可...。
GamiPress – Thrive Quiz Builder integration 》透過功能強大的遊戲化外掛程式 GamiPress,使得您的 Thrive Quiz Builder 測驗變得更加有趣!, 此外掛程式會自動連接 GamiPress 和 Thrive Quiz Builder,新...。
Events Manager OpenStreetMap 》這個外掛為 [Events Manager] 新增條件邏輯功能。, Events Manager OpenStreetMap 是一個針對 Events Manager 的 WordPress 外掛,它允許您在所有活動位置上...。
Advanced Pricing Addon For Wp Bakery 》這是一個針對 Wp Bakery (Js Composer) 外掛的高級定價模組,擴展了 Visual Composer,使用 ES 模組(ES Advanced Pricing Addon)透過 VC Builder 顯示定價...。
Course Wizard for Sensei 》創建、複製和編輯Sensei的課程、模組、課程和問題。 與必須在5到6個全屏幕選項之間進行導航不同,向導將幫助您在同一個直觀的界面中設計課程。 最後但並非最...。
DMS Shortcode Module For Divi 》需要在另一個 Divi 模組內定位一個模組或佈局嗎?, 使用 DMS Shortcode Module For Divi,您可以輕鬆實現這一點,可以在其他 Divi 模組內使用 Divi 模組。, ...。
Hoteliers.com Booking Module 》此外掛已被取消使用,您可以在Hoteliers.com支援中心找到新的預訂程式。。
GamiPress – Thrive Apprentice integration 》透過強大的 gamification 外掛程式 GamiPress,為您的 Thrive Apprentice 課程添加遊戲化元素!, 這個外掛程式會自動連接 GamiPress 和 Thrive Apprentice,...。
Wuunder Shipping Module 》你好,我們是 Wuunder, 你好,我們是Wuunder。我們為您提供輕鬆、個性化和高效的包裹、棧板和文件運送服務。作為一名企業主,您可以使用手機、平板電腦或電腦...。
Wp-marquee 》一個非常簡單但實用的小工具,使用 jQuery 實現特效轉換,您可以選擇顯示的類別和標題數量。, 通過 CSS 文件輕鬆更改跑馬燈的外觀。, , Jquery 腳本由以下網...。