[WordPress] 外掛分享: Shortcode Empty Paragraph Fix

前言介紹

  • 這款 WordPress 外掛「Shortcode Empty Paragraph Fix」是 2011-07-09 上架。
  • 目前有 1000 個安裝啟用數。
  • 上一次更新是 2016-01-22,距離現在已有 3389 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 2.5 以上版本才可以安裝。
  • 有 20 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

jonua |

外掛標籤

fix | shortcode |

內容簡介

修復當短代碼嵌入已由 wpautop 過濾的內容塊中時的 已知問題。

給主題開發者的

如果你正在開發一個可以在市集上提供的主題,你最好將以下的代碼嵌入到你的 functions.php 中。這個代碼只過濾你定義的短代碼。否則你有可能會因為外掛程式過濾了一般的內容而被審核失敗。

function shortcode_empty_paragraph_fix( $content ) {

// define your shortcodes to filter, '' filters all shortcodes
$shortcodes = array( 'your_shortcode_1', 'your_shortcode_2' );

foreach ( $shortcodes as $shortcode ) {

$array = array (
'

[' . $shortcode => '[' .$shortcode,
'

[/' . $shortcode => '[/' .$shortcode,
$shortcode . ']

' => $shortcode . ']',
$shortcode . ']
' => $shortcode . ']'
);

$content = strtr( $content, $array );
}

return $content;
}

add_filter( 'the_content', 'shortcode_empty_paragraph_fix' );

另外一個在 Envato(ThemeForest)市集上被接受的解決方案來自bitfade。

原文外掛簡介

Fix known issues when shortcodes are embedded in a block of content that is filtered by wpautop.
for Theme Developers
If you are developing a theme to provide this on a marketplace, you better embed the following code in your functions.php. This code filters only the shortcodes you defined. Otherwise you risk a failed review because the code in the plugin filters content in general which may is not acceptet.
function shortcode_empty_paragraph_fix( $content ) {

// define your shortcodes to filter, '' filters all shortcodes
$shortcodes = array( 'your_shortcode_1', 'your_shortcode_2' );

foreach ( $shortcodes as $shortcode ) {

$array = array (
'

[' . $shortcode => '[' .$shortcode,
'

[/' . $shortcode => '[/' .$shortcode,
$shortcode . ']

' => $shortcode . ']',
$shortcode . ']
' => $shortcode . ']'
);

$content = strtr( $content, $array );
}

return $content;
}

add_filter( 'the_content', 'shortcode_empty_paragraph_fix' );

Another solution that is acceptet at the envato (themeforest) marketplace comes from bitfade.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Shortcode Empty Paragraph Fix」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


最新版本

延伸相關外掛(你可能也想知道)

  • Image Rotation Repair 》圖片旋轉修復外掛僅僅是根據 EXIF 數據修復圖片方向。主要是為了修復從 iPhone 傳送的錯誤方向圖片的問題。該外掛會篩選所有上傳的圖片,如果 EXIF->方向...。
  • Enable CORS 》外掛會收集網站 URL 與啟用的外掛列表,以提供支援。但不會分享給第三方。本外掛可幫助解決CORS問題,讓您輕鬆存取跨域資源。只需幾個簡單點擊,就能在網站上...。
  • Force Reinstall 》「Force Reinstall」外掛是一個很有用的工具,當你需要在 WordPress 網站上重裝插件或佈景主題時,它會派上用場。不論你在更新時發生了錯誤、懷疑插件受到惡...。
  • Image Rotation Fixer 》此外掛會利用 PHP 的 EXIF 套件,在圖片上傳到伺服器後,自動修正 JPEG 圖片的旋轉問題。此外掛不需要進行任何設定,它會自動連結到 WordPress 的上傳程序,...。
  • Admin Bar Fix 》修正管理列在顯示太多項目時的損毀的版面配置,移除討人厭的頂部邊距,隱藏一些不必要的管理列項目, , 修正多行管理列, 移除 WordPress 插入的 32 像素邊距, ...。
  • TinyMCE Advanced qTranslate fix editor problems 》這個外掛可以修復 TinyMCE Advanced 和 qTranslate 之間的問題。它可以移除換行和空格、啟用自訂樣式表和多個文字區塊,完全可定制。, 外掛首頁:http://www....。
  • Fresh Plugins 》Fresh Plugins 是一個簡單的外掛程式,允許透過 WordPress 標準的外掛程式更新程序重新安裝外掛程式。使用本外掛程式,您可以安裝 WordPress.org 外掛程式庫...。
  • Faster Appearance – Menus 》WordPress 3.6的外觀>菜單面板中的新可訪問性Javascript,在使用大量菜單項目(> 50)時會顯著減慢頁面加載速度。此外掛將可訪問性處理推遲,消除腳本瓶頸,...。
  • SKU Error Fixer for WooCommerce 》當你使用 WooCommerce 外掛在網店中創建新產品時,你可能會遇到產品獨特 SKU 錯誤,並且 SKU無法正常保存。這是因為在數據庫中存在先前創建產品的舊版本變化...。
  • FG Fix Serialized Strings 》此外掛修正 wp_options 資料表中的序列化字串,重新計算每個字串的長度。, 如果您在 SQL 備份檔案中進行全域搜尋/取代,這個外掛可能非常有用。, 主要功能包...。
  • WH Tweaks 》許多來自 WordPress 建議 (https://wordpress.org/ideas/) 或 WordPress 追蹤系統 (https://core.trac.wordpress.org/) 的錯誤,甚至持續數年仍未被納入 Word...。
  • SSL Fixer 》SSL Fixer 可以對資料庫進行一些更改,以修復任何不安全的連結,並在一次點擊中有效地解決 HTTPS 重定向和混合內容問題。具體來說,它有以下兩個功能:, , 修...。
  • Global Styles Mods – WordPress 5.9 fix 》外掛目的, 這個外掛程式可以修復 WordPress 5.9 引入的樣式問題。, 👍 適合使用外掛程式的情況, , ✅ 您使用的 WordPress 版本是 5.9 或更新, ✅ 您正在使用...。
  • Fix Another update is currently in progress 》無需任何配置,只需點擊一下即可修復在更新 WordPress 核心或自動更新主題和插件時出現的「另一個更新正在進行中」的問題。, 詳細資訊請參閱簡單的一頁文檔。...。
  • Fix Category Count 》此外掛可讓您輕鬆修復並修正文章、頁面和自訂文章類型的分類計數。, 您可以修復特定或所有的文章類型分類。, 建議您先備份資料庫後再使用此外掛。, 可能的升...。

文章
Filter
Apply Filters
Mastodon