[WordPress] 外掛分享: Sticky CPT

首頁 › 外掛目錄 › Sticky CPT
WordPress 外掛 Sticky CPT 的封面圖片
40+
安裝啟用
★★★★★
5/5 分(2 則評價)
29 天前
最後更新
—
問題解決
WordPress 6.6+ PHP 8.2+ v3.0.0 上架:2016-10-22

內容簡介

Sticky CPT 外掛允許使用者將自訂文章類型(CPT)內容設為置頂,類似於 WordPress 核心對於文章的功能。這樣可以輕鬆突出顯示新創建的內容,並支援快速編輯及批量操作。

【主要功能】
• 支援自訂文章類型的置頂功能
• 快速編輯和批量操作的便捷性
• 在區塊編輯器和經典編輯器中均可使用
• 置頂項目存儲於核心 sticky_posts 選項
• 兼容 is_sticky() 函數

外掛標籤

開發者團隊

⬇ 下載最新版 (v3.0.0) 或搜尋安裝

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

原文外掛簡介

The plugin allows to highlight the CPT in the same way as would the WordPress core functionality for posts.
You can highlight new content created for your CPT.
It is also possible to highlight the content quickly thanks to quick edit and bulk actions.
The sticky checkbox is available in the block editor, in the classic editor, in quick edit and in bulk edit, for every public custom post type.
Sticky items are stored in the core sticky_posts option, exactly like sticky posts: is_sticky() works out of the box.
Start example
$args = array(
'post_type' => ['project'],
'post_status' => 'publish',
'posts_per_page' => -1,
'post__in' => get_option( 'sticky_posts' )
);
$stickyProject = new WP_Query( $args );

Hook available
add_filter( 'sticky_cpt_add_cpt' , 'add_cpt' );

function add_cpt( $post_types ) {
$post_types['newcpt'] = 'newcpt';
return $post_types;
}

延伸相關外掛

文章
Filter
Mastodon