Title: PCo Image Widget Field
Author: Compute
Published: <strong>2013年8月7日</strong>
Last modified: 2018年1月29日

---

プラグインを検索

![](https://ps.w.org/pco-image-widget-field/assets/banner-772x250.png?rev=752793)

このプラグインは **WordPress の最新3回のメジャーリリースに対してテストされていま
せん**。もうメンテナンスやサポートがされていないかもしれず、最新バージョンの WordPress
で使用した場合は互換性の問題が発生する可能性があります。

![](https://ps.w.org/pco-image-widget-field/assets/icon.svg?rev=975541)

# PCo Image Widget Field

 作者: [Compute](https://profiles.wordpress.org/compute/)

[ダウンロード](https://downloads.wordpress.org/plugin/pco-image-widget-field.1.1.3.zip)

 * [詳細](https://ja.wordpress.org/plugins/pco-image-widget-field/#description)
 * [レビュー](https://ja.wordpress.org/plugins/pco-image-widget-field/#reviews)
 *  [インストール](https://ja.wordpress.org/plugins/pco-image-widget-field/#installation)
 * [開発](https://ja.wordpress.org/plugins/pco-image-widget-field/#developers)

 [サポート](https://wordpress.org/support/plugin/pco-image-widget-field/)

## 説明

#### Features

PCo Image Widget Field allows developers to add multiple image fields to custom 
widgets.

By calling `pco_image_field()` inside your widget’s form() function, you will be
able to give your users a way to add images via the WordPress Media Frame.

#### Translations

 * Standard English by [compute](https://profiles.wordpress.org/compute)
 * Danish by [compute](https://profiles.wordpress.org/compute)
 * German by [dbanck](https://github.com/dbanck)

There are just a few strings to translate. However, it would be great to have more
languages available. Please [contact us](https://ja.wordpress.org/plugins/pco-image-widget-field/wordpress@peytz.dk?output_format=md)
to add your translation to the plugin!

Contribute to [this project](https://github.com/Peytz-WordPress/pco-image-widget-field)
on [github](https://github.com/Peytz-WordPress) or find [all of our favorite and custom made plugins](https://profiles.wordpress.org/peytzco/)

## スクリーンショット

[⌊Select your image.⌉⌊Select your image.⌉[

Select your image.

[⌊Media frame opens. Pick your image and click update.⌉⌊Media frame opens. Pick 
your image and click update.⌉[

Media frame opens. Pick your image and click update.

[⌊Save your stuff.⌉⌊Save your stuff.⌉[

Save your stuff.

[⌊And output the image in your widget.⌉⌊And output the image in your widget.⌉[

And output the image in your widget.

## インストール

 1. Add the plugin by either downloading the folder and uploading it to the wp-content/
    plugins directory or install it from the Control Panel using Plugins->Add New.
 2. Activate PCo Image Widget Field from the Plugins menu using Plugins->Installed 
    Plugins.
 3. Put `pco_image_field( $this, $instance );` inside your Widget’s form() method.

#### Configuration

It’s possible to add settings to the function by adding a settings array as a third
argument: `array( 'title' => 'your-title', 'update' => 'your-update-text', 'field'
=> 'your-image-field' )`. Here are what each setting does…

 * **title** – The title text in the upper left corner of the Media Frame. Defaults
   to ´Image´
 * **update-text** – The text on the update button in the lower right corner of 
   the Media Frame. Defaults to ´Update Image´
 * **field** – The field name. Change this if you need multiple images in one widget.
   Defaults to ´image_id´

Note that this plugin will not save your widget data or show your image anywhere
on the front-end. It will simply store the field inside the $new_instance array 
and wait for you to save the widget. Once the widget instance is saved, you will
be able to retrieve the image id from the widget data.

## FAQ

  Installation Instructions

 1. Add the plugin by either downloading the folder and uploading it to the wp-content/
    plugins directory or install it from the Control Panel using Plugins->Add New.
 2. Activate PCo Image Widget Field from the Plugins menu using Plugins->Installed 
    Plugins.
 3. Put `pco_image_field( $this, $instance );` inside your Widget’s form() method.

#### Configuration

It’s possible to add settings to the function by adding a settings array as a third
argument: `array( 'title' => 'your-title', 'update' => 'your-update-text', 'field'
=> 'your-image-field' )`. Here are what each setting does…

 * **title** – The title text in the upper left corner of the Media Frame. Defaults
   to ´Image´
 * **update-text** – The text on the update button in the lower right corner of 
   the Media Frame. Defaults to ´Update Image´
 * **field** – The field name. Change this if you need multiple images in one widget.
   Defaults to ´image_id´

Note that this plugin will not save your widget data or show your image anywhere
on the front-end. It will simply store the field inside the $new_instance array 
and wait for you to save the widget. Once the widget instance is saved, you will
be able to retrieve the image id from the widget data.

  Will this work for WordPress versions earlier than 3.5.0?

No. This plugin was build to make the Media Frame more useful.
 Older versions of
WordPress will have to use thickbox instead. You can use the [Widget Image Field](https://wordpress.org/plugins/widget-image-field/)
plugin instead, but it’s recommended that you update your WordPress installation
instead.

  Will this automatically add an image field to my widget when I install it?

No. This plugin just creates the building blocks.
 You will have to manually add
the function `pco_image_field( $this, $instance )` inside your widget.

  But I cannot code

Sad. Try these alternatives instead: [Image Widget](https://wordpress.org/plugins/image-widget/)
or [Simple Image Widget](https://wordpress.org/plugins/simple-image-widget/)

This plugin was build to let developers easily add an image field to their widgets.
If you have a developer available this will be an easy task.

  I have added the function but it returns warnings and kills my script. Eh?

Make sure the plugin has been activated. Adding a function that doesn’t exists will
produce a PHP warning and kill the script. To prevent these errors you can use a
function_exists before calling `pco_image_field()`.

  What if I don’t declare any fields to the settings array?

You don’t have to define the settings array. The default field is image_id, and 
is recommended for simplicity.

  What if I want to create multiple image fields inside my widget?

Define the field in the setting array. For example:
 pco_image_field( $this, $instance,
array( ‘field’ => ‘my_image_id’ ) ); pco_image_field( $this, $instance, array( ‘
field’ => ‘my_next_image_id’ ) ); pco_image_field( $this, $instance, array( ‘field’
=> ‘my_last_image_id’ ) );

  The image will not save

Save your field inside your widgets `update()`.

  None of my data is saved

There is a problem with your widget.

  It seems like it’s saving my data but I don’t get anything on the frontend?

Then you will have to output the image in your theme.
 Get the image id from `$instance['
image_id'];` and use a function like `wp get attachment image();`.

  Well your plugin conflicts with…

Let us know!
 Please add a new ticket inside our support forum!

  Too much hard coding 🙁 . I need a hook/functionality for…

Please add a new ticket inside our support forum and tell us about the feature request
you need!

## 評価

![](https://secure.gravatar.com/avatar/1846820a4eb72993f0a7422a93416ac8968527d3a2eaf901672359ff60136e80?
s=60&d=retro&r=g)

### 󠀁[Wow! You developed very useful thing!](https://wordpress.org/support/topic/wow-you-developed-very-useful-thing/)󠁿

 [AlexSpace](https://profiles.wordpress.org/alexspace/) 2016年9月3日 1 reply

Man, really, you implemented two of my ideas for plugins! =) ( Image Widget Field&
Kint ) I am glad that these ones I won’t create, but will develop something else!
Thank you, your plugins are awesome!

![](https://secure.gravatar.com/avatar/2f38e0079443f07758b798a828b8c8322978713e5a146c77e8b9f20d678ab440?
s=60&d=retro&r=g)

### 󠀁[Worked straight away, recommend.](https://wordpress.org/support/topic/worked-straight-away-recommend/)󠁿

 [SEOplay](https://profiles.wordpress.org/seoplay/) 2016年9月3日 1 reply

Very easy to use, just remember to update your function update() 🙂

 [ 3件のレビューをすべて表示 ](https://wordpress.org/support/plugin/pco-image-widget-field/reviews/)

## 貢献者と開発者

PCo Image Widget Field はオープンソースソフトウェアです。以下の人々がこのプラグイン
に貢献しています。

貢献者

 *   [ Compute ](https://profiles.wordpress.org/compute/)
 *   [ Peytz & Co ](https://profiles.wordpress.org/peytzco/)

[“PCo Image Widget Field” をあなたの言語に翻訳しましょう。](https://translate.wordpress.org/projects/wp-plugins/pco-image-widget-field)

### 開発に興味がありますか ?

[コードを閲覧](https://plugins.trac.wordpress.org/browser/pco-image-widget-field/)
するか、[SVN リポジトリ](https://plugins.svn.wordpress.org/pco-image-widget-field/)
をチェックするか、[開発ログ](https://plugins.trac.wordpress.org/log/pco-image-widget-field/)
を [RSS](https://plugins.trac.wordpress.org/log/pco-image-widget-field/?limit=100&mode=stop_on_copy&format=rss)
で購読してみてください。

## 変更履歴

#### 1.1.3

 * Fix issue, where filters in media-model, from other plugins was not showing.

#### 1.1.2

 * Adds german translations (props [@dbanck](https://github.com/dbanck), [#5](https://github.com/Peytz-WordPress/pco-image-widget-field/pull/5)

#### 1.1.1

 * Fixes display of inputs

#### 1.1.0

 * Trigger customizer whenever an update to an image field has accoured

#### 1.0.2

 * Make sure this plugin works together with the customizer

#### 1.0.1

 * Better handling of styles
 * Responsiveness in regards to mp6
 * Global: `$pco_iwf` – Globalization of the plugin object
 * Filter: `pcoiwf_preview_size` – Change the preview size if you’re using wider
   widgets

#### 1.0

 * First release

## メタ

 *  バージョン **1.1.3**
 *  最終更新日 **8年前**
 *  有効インストール数 **100+**
 *  WordPress バージョン ** 3.5またはそれ以降 **
 *  検証済み最新バージョン: **4.9.29**
 *  言語
 * [English (US)](https://wordpress.org/plugins/pco-image-widget-field/)
 * タグ
 * [image](https://ja.wordpress.org/plugins/tags/image/)[upload](https://ja.wordpress.org/plugins/tags/upload/)
   [widget](https://ja.wordpress.org/plugins/tags/widget/)
 *  [詳細を表示](https://ja.wordpress.org/plugins/pco-image-widget-field/advanced/)

## 評価

 5つ星中5つ星

 *  [  3 5-星レビュー     ](https://wordpress.org/support/plugin/pco-image-widget-field/reviews/?filter=5)
 *  [  0 4-星レビュー     ](https://wordpress.org/support/plugin/pco-image-widget-field/reviews/?filter=4)
 *  [  0 3-星レビュー     ](https://wordpress.org/support/plugin/pco-image-widget-field/reviews/?filter=3)
 *  [  0 2-星レビュー     ](https://wordpress.org/support/plugin/pco-image-widget-field/reviews/?filter=2)
 *  [  0 1-星レビュー     ](https://wordpress.org/support/plugin/pco-image-widget-field/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/pco-image-widget-field/reviews/#new-post)

[すべてのレビューを見る](https://wordpress.org/support/plugin/pco-image-widget-field/reviews/)

## 貢献者

 *   [ Compute ](https://profiles.wordpress.org/compute/)
 *   [ Peytz & Co ](https://profiles.wordpress.org/peytzco/)

## サポート

意見や質問がありますか ?

 [サポートフォーラムを表示](https://wordpress.org/support/plugin/pco-image-widget-field/)