前言介紹
- 這款 WordPress 外掛「SB Uploader」是 2011-03-16 上架。
- 目前有 50 個安裝啟用數。
- 上一次更新是 2013-09-17,距離現在已有 4245 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
- 有 1 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
resize | timthumb | uploader | sb uploader | feature image |
內容簡介
我原本為客戶撰寫這個外掛,藉此讓企業徽標顯示在 WordPress 文章內⋯⋯你認為很簡單?那如果我們面對的是對於 WordPress 的「新增媒體」或「新增圖片」頁面毫不知情的使用者。對於大多數人而言,這些操作都非常複雜,因此 SB Uploader 就應運而生了。
這個外掛讓上傳圖片的動作可以在文章 / 頁面編輯器相同的頁面內完成,不需另外有獨立的上傳按鈕,只有像慣常的儲存 / 發佈文章的按鈕。這樣可確保圖片在文章 / 撰寫過程中就可以選擇,而無需等到文章 / 頁面發佈後才進行上傳。
這個外掛可讓你在任何 WordPress 物件中加入任何數量的圖片,包括文章、頁面、分類、標籤、自訂文章型別或自訂分類法。可選擇性設定 WordPress 的特色圖片,以充分利用使用此功能的佈景主題。它還允許提供後備圖片,以便在未上傳圖片時提供。每個圖片都會建立短碼,因此您可以在樣板 / 小工具結構中上傳圖片並使用產生的短碼。
每個上傳者都有後備功能,可讓您集中指定當某個物件沒有上傳圖片時,要放置哪個圖片的 URL。總是有些時候您不想讓特定頁面有圖片,因此我添加了「禁用後備」選項以便實現此目的。
我很確信現在已經涵蓋了全部基本需求......如果您想讓這個外掛以「任何」方式進行擴充,請務必告訴我。
整合說明
它的運作方式(文章 / 頁面 / 自訂文章型別)
在編輯頁面介面的右上角加入一個 metabox,裡面包含一個簡單的檔案選擇器和瀏覽按鈕。當使用者按下發佈 / 儲存按鈕時,檔案會上傳並將 URL 放入命名為插件設置頁面中的自訂欄位的物件內。
許多佈景主題都會使用「特色圖片」,因此此外掛可以輕鬆地設定它,而無需修改佈景主題。或者,如果您希望在佈景主題中更充分地使用它們,可使用以下代碼之一。請注意,這些是函數宣告本身。使用說明在它們之下:
function sbu_get_the_image($custom_field, $post_id=false, $url_only=false, $width=false, $height=false, $quality=100) {
global $sbu;
return $sbu->get_the_post_image($custom_field, $post_id, $url_only, $width, $height, $quality);
}
function sbu_the_image($custom_field, $post_id=false, $url_only=false, $width=false, $height=false, $quality=100) {
echo sbu_get_the_image($custom_field, $post_id, $url_only, $width, $height, $quality);
}
function sbu_get_the_image_resized($custom_field, $width=false, $height=false, $quality=100, $post_id=false) {
return sbu_get_the_image($custom_field, $post_id, false, $width, $height, $quality);
}
function sbu_the_image_resized($custom_field, $width=false, $height=false, $quality=100, $post_id=false) {
echo sbu_get_the_image_resized($custom_field, $width, $height, $quality, $post_id);
}
function sbu_get_the_category_image($custom_field, $post_id=false) {
global $sbu;
return $sbu->get_taxonomy_image($custom_field, $post_id);
}
以下代碼可從核心上傳者那裡抓取圖片,用於「特色圖片」功能。此方法會將多個版本的圖片調整大小並保存在系統中,就像通常使用 WP 上傳者一樣,但介面更簡單、更適合消費者使用。
function sbu_the_wp_image($image_size_name='full', $post_
原文外掛簡介
I originally wrote this for a client as a way to get company logos to appear inside WordPress posts… easy you say huh? What about if we were dealing with people who had no idea what to do when looking at the standard WordPress ‘Add Media’ or ‘Add Image’ page. It all seemed a bit too complicated for the average person so SB Uploader was born.
The idea of the plugin is that it means the act of uploading an image can be done on the same page as the Post/Page editor and there is no separate upload button, just the Save/Publish Post/Page button as normal. This ensures that as part of their blog post or copywriting process an image could be chosen before publishing.
This plugin lets you add as many images as you like to any WordPress object.. be it Posts, Pages, Categories, Tags, Custom Post Types or Custom Taxomonies. It optionally can set the WordPress Featured Image to take advantages of themes that use this feature. It also allows for a fallback image which will be provided in the event that an image was not uploaded. Shortcodes are created for each image so that you can upload images and use the resultant shortcode anywhere in your template/widget structure.
There is a fallback feature with each uploader to allow you to centrally specify the URL of an image to put in place when one is not uploaded to an object. There are always times when you don’t want an image on a specific page so I have added a ‘disable fallback’ option to facilitate this.
I’m pretty sure that’s all bases covered for now.. Do let me know if you want to see this plugin extended in ANY way.
Integration Instructions
How does it work (Posts/Pages/Custom Post Types)?
A metabox is added to the top right hand corner of the edit page interface with a simple file selector with browse button. When the user hits Publish/Save the file is uploaded and the URL put into an object custom field named per the settings page included with the plugin.
A lot of themes will make use of the Featured Image and as such this plugin can easily set this with no theme modification necessary. Alternatively if you wish to use them more fully within your theme you can use one of the following pieces of code. Note that these are the function declarations themselves. The usage instructions are below them:
function sbu_get_the_image($custom_field, $post_id=false, $url_only=false, $width=false, $height=false, $quality=100) {
global $sbu;
return $sbu->get_the_post_image($custom_field, $post_id, $url_only, $width, $height, $quality);
}
function sbu_the_image($custom_field, $post_id=false, $url_only=false, $width=false, $height=false, $quality=100) {
echo sbu_get_the_image($custom_field, $post_id, $url_only, $width, $height, $quality);
}
function sbu_get_the_image_resized($custom_field, $width=false, $height=false, $quality=100, $post_id=false) {
return sbu_get_the_image($custom_field, $post_id, false, $width, $height, $quality);
}
function sbu_the_image_resized($custom_field, $width=false, $height=false, $quality=100, $post_id=false) {
echo sbu_get_the_image_resized($custom_field, $width, $height, $quality, $post_id);
}
function sbu_get_the_category_image($custom_field, $post_id=false) {
global $sbu;
return $sbu->get_taxonomy_image($custom_field, $post_id);
}
The following code to grab images from the core uploader for the Featured Image functionality. This method resizes and saves multiple versions within the system as you would expect from the normal WP uploader but with a simpler, more customer friendly, interface.
get_image($image_size_name, $post_id);
}
?>
If the above doesn’t make sense then, in basic terms, you just need to put something like this in your theme:
or if you wish to resize an image to fit a slot use this:
This would output the image as 700×200. Both parameters are optional so if you wanted a proportional resize based on 700 pixels in width then use this:
Or the old fashioned direct method of retrieving the image.
if ($image = get_post_meta(get_the_ID(), 'post_image', true)) {
$image = '';
}
echo $image;
How does it work (Tags/Categories/Taxonomies)?
As above but the file upload boxes are added to the taxonomy edit pages instead. Just click browse, choose an image and save the taxonomy/tag/category and you’re done.
I would normally wrap the image variable in a div tag with a class or give the image itself a class so that I can restrict the size or float the image (or both?) using the stylesheet. It simply means that you can include that image inside a template if it exists. Of course you could use the resize function I have provided above to get that perfect sized image on your site.
Note
I would like to add that there are coffee/donation adverts in this plugin. I personally hate it when, on adding a new plugin, dashboard widgets, donate buttons and begging messages appear. This plugin is clutter free and support is always available via my site (best responses here) and the WP forums (slower responses but I will get back to you). Have fun!
More info at http://www.sean-barton.co.uk/sb-uploader/
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「SB Uploader」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
EWWW Image Optimizer 》你是否對緩慢的網站感到沮喪?超大的圖片讓你感到 "噁心"?讓 EWWW Image Optimizer 儘可能幫助你的網站加速,提高跳出率並增強 SEO。最重要的是,讓訪客感到...。
ShortPixel Image Optimizer – Optimize Images, Convert WebP & AVIF 》這是一個免費的圖片壓縮外掛程式,擁有易於使用、全面、輕量、穩定和頻繁更新的特點,由友善的團隊開發和支援。, 透過此外掛程式優化您網站上任何圖片或 PDF ...。
Imsanity 》使用 Imsanity,自動調整大型圖片上傳大小。選擇你喜歡的尺寸和品質,讓 Imsanity 完成其餘所有工作。當投稿者上傳大於配置尺寸的圖片時,Imsanity 將自動將...。
Resize Image After Upload 》一款免費、快速、易用、穩定且經常更新的 WordPress 外掛,可在上傳圖片後縮小圖片大小。這款外掛由友好的 ShortPixel 團隊開發 🙂, 這款外掛能在 JPEG、GIF ...。
Advanced iFrame 》看起來您正在尋找一個 WordPress 外掛 - Advanced iFrame Pro。這個外掛可讓您使用 iframe 包含其他網頁到您的網站中,同時具有隱藏和修改元素、自動調整高度...。
Fly Dynamic Image Resizer 》進入 Github 倉庫 ♥, 主題開發人員最大的問題之一是多個圖片尺寸的問題。當您在媒體庫上傳圖像時,WordPress 根據您使用 add_image_size() 定義的所有圖像尺...。
Resize at Upload Plus 》這個外掛基本上只是Resize-At-Upload的一個改善版本,該外掛由A. Huizinga所開發。, 該外掛將根據您定義的最大寬度和高度在上傳時自動調整圖像大小。這樣,您...。
OTF Regenerate Thumbnails 》這個外掛與 Regenerate Thumbnails 差不多,不過圖片會在使用時自動調整大小。一旦圖片生成後,便不會再處理。, 只要以下條件改變,縮略圖就會自動改變大小:...。
Cloudinary – Deliver Images and Videos at Scale 》t, you can sign up for a free account on the Cloudinary website. Once you have an account, you can install our WordPress plugin and start optimizin...。
Auto iFrame 》Auto iFrame 外掛可以輕鬆快速的將 iframe 嵌入到頁面中,並能夠自動調整 iframe 大小以適應嵌入頁面的內容。, Auto iFrame 的縮寫格式如下:, [auto-iframe ...。
WP SmartCrop 》WP SmartCrop 可讓你設定任何圖片的「焦點」,直接從媒體庫進行設置,然後根據你的 CSS 規則裁剪圖片(不再有扁形長寬比例),保持焦點不僅在視野中,而且盡...。
Image Optimization For SEO 》Image Optimization For Seo 是一款 WordPress 的外掛程式,它能調整圖片大小並壓縮圖片以提高網站速度,同時它也會替換圖片的標題和 alt 屬性,而所有更改都...。
Bulk images optimizer: Resize, optimize, convert to webp, rename … 》Bulk image resize 可以讓您優化上傳至 WordPress 的圖片。, , 您可以只點擊一次,就可以調整所有圖片的大小。, 它經過優化以加快批量處理的速度。1000 張圖...。
WPSSO Tune WP Image Editors 》, 您有沒有注意到 WordPress 會創建一些略帶模糊的小圖片 - 與您上傳的原始圖片完全不同?, 調整圖片大小後,必須對圖片進行銳化,但 WordPress 不會進行任何...。
WPThumb 》WP Thumb 是一個可以與 WordPress 的影像功能無縫整合的簡單外掛程式。你可以指定高度、寬度和剪裁值,然後會產生一張影像,並儲存為快取以供未來使用。, 功...。