{"id":24556,"date":"2013-08-07T07:30:27","date_gmt":"2013-08-07T07:30:27","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/pco-image-widget-field\/"},"modified":"2018-01-29T07:17:47","modified_gmt":"2018-01-29T07:17:47","slug":"pco-image-widget-field","status":"publish","type":"plugin","link":"https:\/\/test.wordpress.org\/plugins\/pco-image-widget-field\/","author":8693898,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.1.3","stable_tag":"1.1.3","tested":"4.9.29","requires":"3.5","requires_php":"","requires_plugins":"","header_name":"PCo Image Widget Field","header_author":"Peytz (Patrick Hesselberg & James Bonham)","header_description":"","assets_banners_color":"cccccc","last_updated":"2018-01-29 07:17:47","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/peytz.dk\/medarbejdere\/","header_author_uri":"http:\/\/peytz.dk\/medarbejdere\/","rating":5,"author_block_rating":0,"active_installs":100,"downloads":16667,"num_ratings":3,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"3"},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"975541","resolution":"128x128","location":"assets","width":128,"height":128},"icon.svg":{"filename":"icon.svg","revision":"975541","resolution":"","location":"assets"}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":"752793","resolution":"1544x500","location":"assets","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"752793","resolution":"772x250","location":"assets","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.0.1","1.0.2","1.1.0","1.1.1","1.1.2","1.1.3"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"752793","resolution":"1","location":"assets","width":235,"height":105},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"752793","resolution":"2","location":"assets","width":840,"height":540},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"752793","resolution":"3","location":"assets","width":235,"height":324},"screenshot-4.png":{"filename":"screenshot-4.png","revision":"752793","resolution":"4","location":"assets","width":340,"height":430}},"screenshots":{"1":"Select your image.","2":"Media frame opens. Pick your image and click update.","3":"Save your stuff.","4":"And output the image in your widget."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[133,259,162],"plugin_category":[43,50],"plugin_contributors":[85049,85048],"plugin_business_model":[],"class_list":["post-24556","plugin","type-plugin","status-publish","hentry","plugin_tags-image","plugin_tags-upload","plugin_tags-widget","plugin_category-customization","plugin_category-media","plugin_contributors-compute","plugin_contributors-peytzco","plugin_committers-compute","plugin_committers-peytzco"],"banners":{"banner":"https:\/\/ps.w.org\/pco-image-widget-field\/assets\/banner-772x250.png?rev=752793","banner_2x":"https:\/\/ps.w.org\/pco-image-widget-field\/assets\/banner-1544x500.png?rev=752793","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/pco-image-widget-field\/assets\/icon.svg?rev=975541","icon":"https:\/\/ps.w.org\/pco-image-widget-field\/assets\/icon.svg?rev=975541","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/pco-image-widget-field\/assets\/screenshot-1.png?rev=752793","caption":"Select your image."},{"src":"https:\/\/ps.w.org\/pco-image-widget-field\/assets\/screenshot-2.png?rev=752793","caption":"Media frame opens. Pick your image and click update."},{"src":"https:\/\/ps.w.org\/pco-image-widget-field\/assets\/screenshot-3.png?rev=752793","caption":"Save your stuff."},{"src":"https:\/\/ps.w.org\/pco-image-widget-field\/assets\/screenshot-4.png?rev=752793","caption":"And output the image in your widget."}],"raw_content":"<!--section=description-->\n<h4>Features<\/h4>\n\n<p>PCo Image Widget Field allows developers to add multiple image fields to custom widgets.<\/p>\n\n<p>By calling <code>pco_image_field()<\/code> inside your widget's form() function, you will be able to give your users a way to add images via the WordPress Media Frame.<\/p>\n\n<h4>Translations<\/h4>\n\n<ul>\n<li>Standard English by <a href=\"http:\/\/profiles.wordpress.org\/compute\">compute<\/a><\/li>\n<li>Danish by <a href=\"http:\/\/profiles.wordpress.org\/compute\">compute<\/a><\/li>\n<li>German by <a href=\"https:\/\/github.com\/dbanck\">dbanck<\/a><\/li>\n<\/ul>\n\n<p>There are just a few strings to translate. However, it would be great to have more languages available. Please <a href=\"mailto:&#x77;&#x6f;&#114;&#x64;&#x70;&#114;&#x65;&#x73;&#115;&#x40;&#x70;&#101;&#x79;&#x74;&#122;&#x2e;&#x64;&#107;\">contact us<\/a> to add your translation to the plugin!<\/p>\n\n<p>Contribute to <a href=\"https:\/\/github.com\/Peytz-WordPress\/pco-image-widget-field\">this project<\/a> on <a href=\"https:\/\/github.com\/Peytz-WordPress\">github<\/a> or find <a href=\"http:\/\/profiles.wordpress.org\/peytzco\/\">all of our favorite and custom made plugins<\/a><\/p>\n\n<!--section=installation-->\n<ol>\n<li>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-&gt;Add New.<\/li>\n<li>Activate PCo Image Widget Field from the Plugins menu using Plugins-&gt;Installed Plugins.<\/li>\n<li>Put <code>pco_image_field( $this, $instance );<\/code> inside your Widget's form() method.<\/li>\n<\/ol>\n\n<h4>Configuration<\/h4>\n\n<p>It's possible to add settings to the function by adding a settings array as a third argument: <code>array( 'title' =&gt; 'your-title', 'update' =&gt; 'your-update-text', 'field' =&gt; 'your-image-field' )<\/code>. Here are what each setting does\u2026<\/p>\n\n<ul>\n<li><strong>title<\/strong> - The title text in the upper left corner of the Media Frame. Defaults to \u00b4Image\u00b4<\/li>\n<li><strong>update-text<\/strong> - The text on the update button in the lower right corner of the Media Frame. Defaults to \u00b4Update Image\u00b4<\/li>\n<li><strong>field<\/strong> - The field name. Change this if you need multiple images in one widget. Defaults to \u00b4image_id\u00b4<\/li>\n<\/ul>\n\n<p>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.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt>Installation Instructions<\/dt>\n<dd><ol>\n<li>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-&gt;Add New.<\/li>\n<li>Activate PCo Image Widget Field from the Plugins menu using Plugins-&gt;Installed Plugins.<\/li>\n<li>Put <code>pco_image_field( $this, $instance );<\/code> inside your Widget's form() method.<\/li>\n<\/ol>\n\n<h4>Configuration<\/h4>\n\n<p>It's possible to add settings to the function by adding a settings array as a third argument: <code>array( 'title' =&gt; 'your-title', 'update' =&gt; 'your-update-text', 'field' =&gt; 'your-image-field' )<\/code>. Here are what each setting does\u2026<\/p>\n\n<ul>\n<li><strong>title<\/strong> - The title text in the upper left corner of the Media Frame. Defaults to \u00b4Image\u00b4<\/li>\n<li><strong>update-text<\/strong> - The text on the update button in the lower right corner of the Media Frame. Defaults to \u00b4Update Image\u00b4<\/li>\n<li><strong>field<\/strong> - The field name. Change this if you need multiple images in one widget. Defaults to \u00b4image_id\u00b4<\/li>\n<\/ul>\n\n<p>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.<\/p><\/dd>\n<dt>Will this work for WordPress versions earlier than 3.5.0?<\/dt>\n<dd><p>No. This plugin was build to make the Media Frame more useful.\nOlder versions of WordPress will have to use thickbox instead. You can use the <a href=\"http:\/\/wordpress.org\/plugins\/widget-image-field\/\">Widget Image Field<\/a> plugin instead, but it's recommended that you update your WordPress installation instead.<\/p><\/dd>\n<dt>Will this automatically add an image field to my widget when I install it?<\/dt>\n<dd><p>No. This plugin just creates the building blocks.\nYou will have to manually add the function <code>pco_image_field( $this, $instance )<\/code> inside your widget.<\/p><\/dd>\n<dt>But I cannot code<\/dt>\n<dd><p>Sad. Try these alternatives instead: <a href=\"http:\/\/wordpress.org\/plugins\/image-widget\/\">Image Widget<\/a> or <a href=\"http:\/\/wordpress.org\/plugins\/simple-image-widget\/\">Simple Image Widget<\/a><\/p>\n\n<p>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.<\/p><\/dd>\n<dt>I have added the function but it returns warnings and kills my script. Eh?<\/dt>\n<dd><p>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 <code>pco_image_field()<\/code>.<\/p><\/dd>\n<dt>What if I don't declare any fields to the settings array?<\/dt>\n<dd><p>You don't have to define the settings array. The default field is image_id, and is recommended for simplicity.<\/p><\/dd>\n<dt>What if I want to create multiple image fields inside my widget?<\/dt>\n<dd><p>Define the field in the setting array. For example:\n    pco_image_field( $this, $instance, array( 'field' =&gt; 'my_image_id' ) );\n    pco_image_field( $this, $instance, array( 'field' =&gt; 'my_next_image_id' ) );\n    pco_image_field( $this, $instance, array( 'field' =&gt; 'my_last_image_id' ) );<\/p><\/dd>\n<dt>The image will not save<\/dt>\n<dd><p>Save your field inside your widgets <code>update()<\/code>.<\/p><\/dd>\n<dt>None of my data is saved<\/dt>\n<dd><p>There is a problem with your widget.<\/p><\/dd>\n<dt>It seems like it's saving my data but I don't get anything on the frontend?<\/dt>\n<dd><p>Then you will have to output the image in your theme.\nGet the image id from <code>$instance['image_id'];<\/code> and use a function like <code>wp get attachment image();<\/code>.<\/p><\/dd>\n<dt>Well your plugin conflicts with...<\/dt>\n<dd><p>Let us know!\nPlease add a new ticket inside our support forum!<\/p><\/dd>\n<dt>Too much hard coding :( . I need a hook\/functionality for...<\/dt>\n<dd><p>Please add a new ticket inside our support forum and tell us about the feature request you need!<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.1.3<\/h4>\n\n<ul>\n<li>Fix issue, where filters in media-model, from other plugins was not showing.<\/li>\n<\/ul>\n\n<h4>1.1.2<\/h4>\n\n<ul>\n<li>Adds german translations (props <a href=\"https:\/\/github.com\/dbanck\">@dbanck<\/a>, <a href=\"https:\/\/github.com\/Peytz-WordPress\/pco-image-widget-field\/pull\/5\">#5<\/a><\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>Fixes display of inputs<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Trigger customizer whenever an update to an image field has accoured<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Make sure this plugin works together with the customizer<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Better handling of styles<\/li>\n<li>Responsiveness in regards to mp6<\/li>\n<li>Global: <code>$pco_iwf<\/code> - Globalization of the plugin object<\/li>\n<li>Filter: <code>pcoiwf_preview_size<\/code> - Change the preview size if you're using wider widgets<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>First release<\/li>\n<\/ul>","raw_excerpt":"Easily add image fields to your custom widgets.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/24556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=24556"}],"author":[{"embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/compute"}],"wp:attachment":[{"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=24556"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=24556"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=24556"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=24556"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=24556"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/test.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=24556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}