前言介紹
- 這款 WordPress 外掛「Authors Autocomplete Meta Box」是 2013-05-22 上架。 目前已經下架不再更新,不建議安裝使用。
- 目前有 100 個安裝啟用數。
- 上一次更新是 2013-12-02,距離現在已有 4170 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.3 以上版本才可以安裝。
- 有 5 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
auto | author | authors | complete | autocomplete |
內容簡介
這個外掛將預設的WordPress作者欄位(包含作者下拉式選單)替換為一個可透過自動完成來選擇文章或頁面作者的欄位。
當你擁有許多作者且厭倦捲動長長的作者下拉式選單時,這個外掛可以很方便。
鳴謝
非常感謝ereleases.com外包這個外掛,讓我能與社群分享。你們真棒!
同時也感謝Andrew Kurtis來自WebHostingHub Support提供的西班牙語翻譯。
過濾器
過濾器可以很方便的針對特定項目在每個網站上進行客製化。我是一個絕對的高手,因此我經常使用動作以及過濾器來嵌入我使用的插件。以下是一些非常有幫助的過濾器,讓你能夠按照自己的意願設定作者的自動完成欄位。
authors_autocomplete_mb_allow_user_id
這個過濾器讓你可以阻止使用者根據使用者ID在自動完成的清單中顯示限制;返回true允許顯示,false則是不允許顯示。
它會傳遞使用者ID以及文章ID和文章類型,不要忘記:當使用過濾器時,一定要返回一些東西。這裡有一個例子可以幫助你入門:
// 返回 * true *,以允許使用者顯示;返回 * false * 以拒絕使用者顯示到自動完成的結果中
add_filter('authors_autocomplete_mb_allow_user_id','filter_authors_autocomplete_mb_allow_user_id',1,4);
function filter_authors_autocomplete_mb_allow_user_id ($allow_user_id,$user_id,$post_id,$post_type) {
如果($user_id == 4)
返回false;
返回$allow_user_id;
}
?>
authors_autocomplete_mb_allow_user_role
這個過濾器讓你可以根據使用者角色阻止使用者在自動完成清單中的顯示;返回true允許顯示,false則是不允許。
它會傳遞使用者角色以及文章ID和文章類型,不要忘記:當使用過濾器時,一定要返回一些東西。這裡有一個例子可以幫助你入門:
// 返回 * true *,以允許使用者顯示;返回 * false * 以阻止使用者顯示到自動完成的結果中
add_filter('authors_autocomplete_mb_allow_user_role', 'filter_authors_autocomplete_mb_allow_user_role',1,4);
function filter_authors_autocomplete_mb_allow_user_role ($allow_user_role,$user_role,$post_id,$post_type) {
如果($user_role == 'administrator')
返回false;
返回$allow_user_role;
}
?>
authors_autocomplete_mb_author_capability
當檢查使用者是否擁有作者權限以及是否應將其包含在自動完成的結果中時,外掛會檢查使用者的能力。如果使用者正在編輯頁面,則只會在他們具有edit_pages能力時加入使用者;否則,如果使用者具有edit_posts權力,他們將被加入使用者,如果你想更改作者權限能力,這個過濾器就是為你而設的。它會傳遞預設能力,以及文章ID和文章類型。不要忘記:當使用過濾器時,必須返回東西。這裡有一個例子可以幫助你入門:
// 根據文章類型更改作者靈活性
add_filter('authors_autocomplete_mb_author_capability','filter_authors_autocomplete_mb_author_capability',1,3);
function filter_authors_autocomplete_mb_author_capability ($author_capability,$post_id,$post_type) {
如果($post_type == 'movies')
返回'edit_movies';
返回$author_capability;
}
?>
原文外掛簡介
Replaces the default WordPress Author meta box (that has an author dropdown) with a meta box that allows you to select the post’s, or page’s, author via Autocomplete.
Can really come in handy if you have a lot of authors and are tired of scrolling through that long author dropdown.
Credits
Big shoutout to ereleases.com for commissioning this plugin and letting me share it with the community. Thanks, guys. You rock!
Lots of thanks to Andrew Kurtis from WebHostingHub Support for providing the Spanish translation.
Filters
Filters can really come in handy to nail down specific customizations on a site by site basis. I am what you would consider a power user so I’m a big fan of actions and filters and try to incorporate them into my plugins as much as possible. Here are some pretty helpful filters to get your authors autocomplete meta box working just the way you like.
authors_autocomplete_mb_allow_user_id
This filter allows you to block users from the autocomplete results according to user id. Return true to allow and false to deny.
It passes the user id, along with the post ID and post type. Don’t forget: when using a filter, you MUST return something. Here’s an example to help you get started:
authors_autocomplete_mb_allow_user_role
This filter allows you to block users from the autocomplete results according to user role. Return true to allow and false to deny.
It passes the user role, along with the post ID and post type. Don’t forget: when using a filter, you MUST return something. Here’s an example to help you get started:
authors_autocomplete_mb_author_capability
When checking to see if a user has author privileges, and should therefore be included in the autocomplete results, the plugin checks the user’s capabilities. If the user is editing a page, then the user is added if they have the capability to edit_pages, otherwise the user is added if they have the capability to edit_posts.
If you would like to change the author privilege capability, then this filter is for you. It passes the default capability, along with the post ID and post type. Don’t forget: when using a filter, you MUST return something. Here’s an example to help you get started:
authors_autocomplete_mb_custom_user_search_user_ids
Want the autocomplete box to search information besides the default user_login, display_name and user_email? This is the filter for you.
Use this filter to run whatever search you like and simply return the user IDs from your results.
It passes a blank array to get you started, the search term, post ID and post type. Don’t forget: when using a filter, you MUST return something.
Here’s an example from me helping a user search their CIMY User Extra Fields:
get_col( "SELECT users.ID, cimy_uef_data.VALUE FROM $wpdb->users users LEFT JOIN {$wpdb->prefix}cimy_uef_data cimy_uef_data ON cimy_uef_data.USER_ID = users.ID WHERE ( cimy_uef_data.VALUE LIKE '%$search_term%' OR users.user_login LIKE '%$search_term%' OR users.display_name LIKE '%$search_term%' OR users.user_email LIKE '%$search_term%' ) ORDER BY users.ID ASC" );
}
?>
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Authors Autocomplete Meta Box」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Companion Auto Update 》Companion Auto Update 是一個功能強大且完全免費的外掛,可以幫助您管理 WordPress 網站上的所有更新。我們的目標是為您提供最佳的更新控制,讓您隨時瞭解最...。
Auto Upload Images 》當您想要儲存一篇貼文時,該外掛會搜索存在於貼文中的圖片URL並自動上傳和匯入外部圖片到WordPress上傳目錄中,並將圖片添加到媒體庫中,然後取代新圖片URL舊...。
QQWorld Auto Save Images 》當您發佈文章時,此外掛可以自動將所有遠端圖片保留至本地媒體庫中並自動設置特色圖片。, 還有更強大的功能正在等待您。它到底是什麼?呵呵……, 注意事項:, ,...。
Autologin Links 》這個外掛讓管理員可以為其 WordPress 網站生成自動登入連結,並以特定使用者名稱登入訪客。管理員可以編輯(生成和刪除)使用者的自動登入連結,而使用者只能...。
Auto Affiliate Links 》Auto Affiliate Links(自動聯盟行銷連結)可以自動將聯盟行銷連結添加到您的內容中。您可以手動設置要在哪些關鍵詞和位置添加聯盟行銷連結,也可以讓此外掛...。
Simple Automatic Updates 》這個外掛提供三種管理你的WordPress更新的選擇:, , 自動更新 - 這會自動更新WordPress/佈景主題/外掛,並在更新完成後發送電子郵件給網站管理員。, 自動更新...。
Auto Updates 》現今,保持一切更新(安全性、相容性、新功能和效能)非常重要。預設的 WordPress 設定只會自動安裝小型的核心更新和語言檔案。, 不需設定,只要安裝並啟用此...。
Auto Login New User After Registration 》這個外掛有以下的出色功能:, , , 自動登入:當新使用者註冊時,這個外掛會自動幫他們登入。, , , 重新導向:設定註冊後自動登入後,想要使用者導向的網頁。,...。
Auto Excerpt everywhere 》此外掛是為了幫助那些不想編輯模板檔案(或者太懶得去編輯)的使用者而創建的。, 只要啟用此外掛,它就會自動地在您的首頁、存檔和搜尋結果中顯示文章摘要。,...。
Auto Update Post Date 》### 總結:, 使用 Auto Update Post Date 這個簡單的 WordPress 外掛,可以讓您的內容保持時效性,提升 SEO,並與您的目標受眾保持可信度。快來使用這個完全免...。
WordPress Auto Featured Image 》你有沒有厭倦每次發布頁面、文章或自訂文章類型時都要設置預設特色圖片?或者你想要在發布或更新文章/頁面時自動設置預設特色圖片作為縮略圖?, 這裡有個解決...。
Idle User Logout 》這個外掛可以偵測使用者閒置狀態,並且執行在後台所指定的動作。, 從 2.0 版本開始,您可以針對每個使用者角色指定動作和時間。, 它可以追蹤使用者在前端和後...。
Auto Update Plugins 》此外掛將 WordPress 設置為自動下載並安裝外掛程式更新。, 無需配置,只需安裝並啟用此外掛即可。。
Simple Auto-Poster for Bluesky 》總結:Simple Auto Poster for Bluesky 是一個設定後即可忘記的外掛程式,每當 WordPress 發佈一篇文章時,將自動分享至ATProto網絡,例如 bluesky。只需要擁...。
Hacklog Remote Image Autosave 》此外掛可以自動將文章中的遠程圖片保存到本地伺服器,並將其作為文章的附件添加。, , 與 Hacklog Remote Attachment 外掛和 Watermark Reloaded 外掛相容, ad...。