[WordPress] 外掛分享: Sticky Postbox

首頁外掛目錄 › Sticky Postbox
20+
安裝啟用
尚無評分
1372 天前
最後更新
問題解決
WordPress 4.4+ PHP 5.2.4+ v1.3.0 上架:2022-07-12

內容簡介

Sticky Postbox 是幾年前為了練習學習 WordPress 如何處理管理區塊的不同狀態(已關閉、已隱藏和排序)而寫的程式碼。

這個非常輕量級的外掛程式可以為管理區塊新增置頂功能,讓它們可以固定在瀏覽器視窗的右上角。

每次只有一個管理區塊可以被置頂,所以若已經有一個置頂的區塊,新增置頂區塊會將它取消。

基本功能

可為對應使用者設定。
支援 Multisite。

使用方式

啟用外掛後,您可以使用置頂圖示(出現在每個管理區塊的右上角)來置頂您的管理區塊。

API
常數

您可以在您的 wp-config.php 檔案中使用以下常數。

STICKY_POSTBOX_DEBUG

啟用偵錯訊息(也需要 WP_DEBUG 設為 true)
預設值為 false。

STICKY_POSTBOX_GLOBAL_OPTIONS

在 Multisite 安裝中,允許分享使用者的貼身區塊設定,跨越所有他的網站。例如,若您在特定網站的頁面編輯時,將發佈方塊固定在某個位置,那麼所有網站上的頁面都會應用這個固定的設定。
預設值為 false。

STICKY_POSTBOX_AUTOENABLE

預設情況下,一旦啟用了外掛,它就會自動啟動。
如果要手動啟動,您可以定義為 false,例如:

// 所有插件都已載入後,手動啟動外掛。
add_action( 'plugins_loaded', function() {
\Sticky_Postbox::get_instance(
array(
'debug' => WP_DEBUG,
'global_options' => false,
)
);
} );

鉤子

目前本插件沒有動作或篩選器。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.3.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Sticky Postbox」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Sticky Postbox is a piece of code written few years ago as exercise to learn how WordPress handles administration meta boxes’s availables statuses (closed, hidden and sortings).
This very lightweight plugin adds the sticky feature to administration meta boxes allowing them to be sticky at top right corner of the browser window.
Only one meta box can be sticky at once, so a new sticky meta box unstick the current one (if there is one).
Basic Features

Per-user settings.
Multisite support.

Usage
Once the plugin is installed and activated you can sticky administration meta boxes using sticky icon (it appears on the top right corner of each box).
API
Constants
You can use define following constants in your wp-config.php file.
STICKY_POSTBOX_DEBUG
Turn on debug messages (also WP_DEBUG has to be true).
Default to false.
STICKY_POSTBOX_GLOBAL_OPTIONS
In a Multisite installation, allows to shares user’s sticky meta boxes settings across all his sites. For example, if you sticky Publish box in editing Pages in a specific site, it will be sticky on all Pages of all sites.
Default to false.
STICKY_POSTBOX_AUTOENABLE
By default if the plugin has been activated, it starts automatically.
Define to false if you want to init it manually, for example:
// Activate manually the plugin once all plugin have been loaded.
add_action( 'plugins_loaded', function() {
\Sticky_Postbox::get_instance(
array(
'debug' => WP_DEBUG,
'global_options' => false,
)
);
} );

Hooks
Currently the plugin doesn’t have actions or filters.

延伸相關外掛

文章
Filter
Mastodon