內容簡介
總結:這個 GlotPress 外掛讓你可以在你的項目中新增圖示,讓介面更加豐富多元。
問題與答案:
1. 這個 GlotPress 外掛主要提供了什麼功能?
- 允許在項目中新增圖示。
2. 到 GlotPress v4.0.1 版本前,為何無法輕鬆地在伺服器端上添加圖示?
- 因為模板 'project.php' 和 'projects.php' 沒有必要的鉤子。
3. 目前是如何在前端使用 JavaScript 添加圖示的?
- 目前是透過前端 JavaScript 添加圖示。
4. 如果 PR Add action hooks 和 filters to Projects and Project templates 被合併,將會發生什麼狀況?
- 如果被合併,將不再需要 JavaScript,並且模板自訂將正確進行。
5. 這個外掛使用何種方式來存儲媒體庫附件的 ID?
- 使用 gp_meta,並使用 meta 金鑰 project_icon 來保存對應 ID 的每個類型項目的專案。
6. 這個外掛的主要特點是什麼?
- GlotPress 進行項目編輯/新增時,提供媒體檔選擇欄,可從媒體庫中選擇圖片。
外掛標籤
開發者團隊
原文外掛簡介
This GlotPress plugin allows you to add icons to your projects.
Up to GlotPress v4.0.1 the templates ‘project.php’ and ‘projects.php’ don’t have the necessary hooks to easily add the icons on server side.
For now the icons are added on the frontend with JavaScript.
If the PR Add action hooks and filters to Projects and Project templates is merged, then the JS is no longer needed and the template customization will be done the right way.
The plugin uses gp_meta with the meta key project_icon to store the ID of the media library attachment, for each object of type project with a corresponding ID.
Features
GlotPress projects page:
Icons on the left of the project names.
GlotPress project page:
Header icon above the project title.
Icons on the left of the sub-project names.
GlotPress project edit/new form:
Media file select field to choose an image from the media library.
Known issues
Currently, GlotPress still does not delete meta when deleting a project, leading to orphaned meta.
GlotPress does not clone the meta when branching a project, so any cloned projects do not inherit its icon.
Requirements
GlotPress v4.0.
