Changeset 795804
- Timestamp:
- 10/30/2013 09:56:22 AM (12 years ago)
- Location:
- pinit
- Files:
-
- 6 edited
- 6 copied
-
tags/0.3 (copied) (copied from pinit/trunk)
-
tags/0.3/LICENSE (copied) (copied from pinit/trunk/LICENSE)
-
tags/0.3/js (copied) (copied from pinit/trunk/js)
-
tags/0.3/languages (copied) (copied from pinit/trunk/languages)
-
tags/0.3/languages/it_IT.mo (modified) (previous)
-
tags/0.3/languages/it_IT.po (modified) (2 diffs)
-
tags/0.3/pinit.php (copied) (copied from pinit/trunk/pinit.php) (7 diffs)
-
tags/0.3/readme.txt (copied) (copied from pinit/trunk/readme.txt) (3 diffs)
-
trunk/languages/it_IT.mo (modified) (previous)
-
trunk/languages/it_IT.po (modified) (2 diffs)
-
trunk/pinit.php (modified) (7 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pinit/tags/0.3/languages/it_IT.po
r795787 r795804 2 2 msgstr "" 3 3 "Project-Id-Version: Pinit\n" 4 "POT-Creation-Date: 2013-10-28 1 4:52+0100\n"5 "PO-Revision-Date: 2013-10-28 1 4:56+0100\n"4 "POT-Creation-Date: 2013-10-28 15:48+0100\n" 5 "PO-Revision-Date: 2013-10-28 15:49+0100\n" 6 6 "Last-Translator: Mattia Migliorini <[email protected]>\n" 7 7 "Language-Team: Mattia Migliorini <[email protected]>\n" … … 16 16 #: ../pinit.php:34 17 17 msgid "Pinterest Profile Widget" 18 msgstr " Pinterest Widget Profilo"18 msgstr "Widget Profilo Pinterest" 19 19 20 20 #: ../pinit.php:35 21 msgid "" 22 "Pinterest Profile Widget: show up to 30 of your latest pins on your site." 23 msgstr "" 24 "Pinterest Widget Profilo: mostra fino a 30 dei tuoi pin recenti nel tuo sito." 21 msgid "Show up to 30 of your latest pins on your site." 22 msgstr "Mostra fino a 30 dei tuoi pin recenti nel tuo sito." 25 23 26 #: ../pinit.php:86 24 #: ../pinit.php:86 ../pinit.php:203 27 25 msgid "Title:" 28 26 msgstr "Titolo:" 29 27 30 #: ../pinit.php:91 28 #: ../pinit.php:91 ../pinit.php:208 31 29 msgid "Pinterest User URL:" 32 30 msgstr "URL Profilo Pinterest:" 33 31 34 #: ../pinit.php:98 32 #: ../pinit.php:98 ../pinit.php:215 35 33 msgid "Image Width:" 36 34 msgstr "Larghezza immagine:" 37 35 38 #: ../pinit.php:101 39 msgid "min: 60; leave 0 for 92"40 msgstr "min: 60; lasciare 0 per 92"36 #: ../pinit.php:101 ../pinit.php:218 37 msgid "min: 60; leave 0 or blank for 92" 38 msgstr "min: 60; lasciare 0 o vuoto per 92" 41 39 42 #: ../pinit.php:105 40 #: ../pinit.php:105 ../pinit.php:222 43 41 msgid "Board Height:" 44 msgstr "Altezza widget:"42 msgstr "Altezza bacheca:" 45 43 46 #: ../pinit.php:108 47 msgid "min: 60; leave 0 for 175"48 msgstr "min: 60; lasciare 0 per 175"44 #: ../pinit.php:108 ../pinit.php:225 45 msgid "min: 60; leave 0 or blank for 175" 46 msgstr "min: 60; lasciare 0 o vuoto per 175" 49 47 50 #: ../pinit.php:112 48 #: ../pinit.php:112 ../pinit.php:229 51 49 msgid "Board Width:" 52 msgstr "Larghezza widget:"50 msgstr "Larghezza bacheca:" 53 51 54 #: ../pinit.php:115 55 msgid "min: 130; leave 0 for auto" 56 msgstr "min: 130; lasciare 0 per auto" 52 #: ../pinit.php:115 ../pinit.php:232 53 msgid "min: 130; leave 0 or blank for auto" 54 msgstr "min: 130; lasciare 0 o vuoto per auto" 55 56 #: ../pinit.php:151 57 msgid "Pinterest Board Widget" 58 msgstr "Widget Bacheca Pinterest" 59 60 #: ../pinit.php:152 61 msgid "Show up to 30 of your favorite board's latest pins." 62 msgstr "Mostra fino a 30 dei pin recenti dalla tua bacheca preferita." -
pinit/tags/0.3/pinit.php
r795787 r795804 5 5 * Description: Handy plugin that adds Pinterest Follow Button, Pin Widget, Profile Widget and Board Widget to your WordPress site. 6 6 * Author: Mattia Migliorini 7 * Version: 0. 17 * Version: 0.3 8 8 * Author URI: http://www.deshack.net 9 9 * License: GPLv2 or later … … 33 33 'pit_widget_profile', // Base ID 34 34 __( 'Pinterest Profile Widget', 'pit' ), // Name 35 array( 'description' => __( ' Pinterest Profile Widget: show up to 30 of your latest pins on your site.', 'pit' ) ) // Args35 array( 'description' => __( 'Show up to 30 of your latest pins on your site.', 'pit' ) ) // Args 36 36 ); 37 37 } … … 47 47 public function widget( $args, $instance ) { 48 48 $title = apply_filters( 'widget_title', $instance['title'] ); 49 $u rl = $instance['url'];49 $user = $instance['user']; 50 50 $image_width = $instance['image_width']; 51 51 $width = $instance['width']; … … 67 67 $data_width = ' data-pin-board-width="' . $width . '"'; 68 68 69 if ( ! empty( $u rl) )70 echo '<a data-pin-do="embedUser" href=" ' . $url . '"' . $data_image_width . $data_height . $data_width . '></a>';69 if ( ! empty( $user ) ) 70 echo '<a data-pin-do="embedUser" href="http://www.pinterest.com/' . $user . '/"' . $data_image_width . $data_height . $data_width . '></a>'; 71 71 72 72 echo $args['after_widget']; … … 89 89 90 90 <p> 91 <label for="<?php echo $this->get_field_id('u rl'); ?>"><?php _e( 'Pinterest User URL:', 'pit' ); ?></label>92 <input class="widefat" id="<?php echo $this->get_field_id('u rl'); ?>" name="<?php echo $this->get_field_name('url'); ?>" type="text" value="<?php echo esc_attr( $instance['url'] ); ?>">93 <br> 94 <small>http://www.pinterest.com/ username/</small>91 <label for="<?php echo $this->get_field_id('user'); ?>"><?php _e( 'Pinterest Username:', 'pit' ); ?></label> 92 <input class="widefat" id="<?php echo $this->get_field_id('user'); ?>" name="<?php echo $this->get_field_name('user'); ?>" type="text" value="<?php echo esc_attr( $instance['user'] ); ?>"> 93 <br> 94 <small>http://www.pinterest.com/<strong>username</strong>/</small> 95 95 </p> 96 96 97 97 <p> 98 98 <label for="<?php echo $this->get_field_id('image_width'); ?>"><?php _e( 'Image Width:', 'pit' ); ?></label> 99 <input class="widefat " id="<?php echo $this->get_field_id('image_width'); ?>" name="<?php echo $this->get_field_name('image_width'); ?>" type="text" value="<?php echo esc_attr( $instance['image_width'] ); ?>">100 <br> 101 <small><?php _e( 'min: 60; leave 0 for 92', 'pit' ); ?></small>99 <input class="widefat pit-image-width" id="<?php echo $this->get_field_id('image_width'); ?>" name="<?php echo $this->get_field_name('image_width'); ?>" type="text" value="<?php echo esc_attr( $instance['image_width'] ); ?>"> 100 <br> 101 <small><?php _e( 'min: 60; leave 0 or blank for 92', 'pit' ); ?></small> 102 102 </p> 103 103 104 104 <p> 105 105 <label for="<?php echo $this->get_field_id('height'); ?>"><?php _e( 'Board Height:', 'pit' ); ?></label> 106 <input class="widefat " id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo esc_attr( $instance['height'] ); ?>">107 <br> 108 <small><?php _e( 'min: 60; leave 0 for 175', 'pit' ); ?></small>106 <input class="widefat pit-height" id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo esc_attr( $instance['height'] ); ?>"> 107 <br> 108 <small><?php _e( 'min: 60; leave 0 or blank for 175', 'pit' ); ?></small> 109 109 </p> 110 110 111 111 <p> 112 112 <label for="<?php echo $this->get_field_id('width'); ?>"><?php _e( 'Board Width:', 'pit' ); ?></label> 113 <input class="widefat " id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo esc_attr( $instance['width'] ); ?>">114 <br> 115 <small><?php _e( 'min: 130; leave 0 for auto', 'pit' ); ?></small>113 <input class="widefat pit-width" id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo esc_attr( $instance['width'] ); ?>"> 114 <br> 115 <small><?php _e( 'min: 130; leave 0 or blank for auto', 'pit' ); ?></small> 116 116 </p> 117 117 … … 130 130 $instance = $old_instance; 131 131 $instance['title'] = $new_instance['title']; 132 $instance['u rl'] = esc_url_raw( $new_instance['url'], array('http', 'https') );132 $instance['user'] = $new_instance['user']; 133 133 $instance['image_width'] = intval($new_instance['image_width']); 134 134 $instance['height'] = intval($new_instance['height']); … … 139 139 } 140 140 141 /** 142 * Pinterest Board Widget Class 143 * 144 * @since 0.2 145 */ 146 class pit_widget_board extends WP_Widget { 147 // Constructor 148 function __construct() { 149 parent::__construct( 150 'pit_widget_board', // Base ID 151 __( 'Pinterest Board Widget', 'pit' ), // Name 152 array( 'description' => __( 'Show up to 30 of your favorite board\'s latest pins.', 'pit' ) ) // Args 153 ); 154 } 155 156 /** 157 * Front-end display of widget. 158 * 159 * @see WP_Widget::widget() 160 * 161 * @param array $args. Widget arguments. 162 * @param array $instance. Saved values from database. 163 */ 164 public function widget( $args, $instance ) { 165 $title = apply_filters( 'widget_title', $instance['title'] ); 166 $user = $instance['user']; 167 $board = $instance['board']; 168 $image_width = $instance['image_width']; 169 $width = $instance['width']; 170 $height = $instance['height']; 171 172 echo $args['before_widget']; 173 if ( ! empty( $title ) ) 174 echo $args['before_title'] . $title . $args['after_title']; 175 176 $data_image_width = ''; 177 $data_width = ''; 178 $data_height = ''; 179 180 if ( ! empty( $image_width ) ) 181 $data_image_width = ' data-pin-scale-width="' . $image_width . '"'; 182 if ( ! empty( $height ) ) 183 $data_height = ' data-pin-scale-height="' . $height . '"'; 184 if ( ! empty( $width ) ) 185 $data_width = ' data-pin-board-width="' . $width . '"'; 186 187 if ( ! empty( $user ) && ! empty( $board ) ) 188 echo '<a data-pin-do="embedBoard" href="http://www.pinterest.com/' . $user . '/' . $board . '/"' . $data_image_width . $data_height . $data_width . '></a>'; 189 190 echo $args['after_widget']; 191 } 192 193 /** 194 * Back-end widget form. 195 * 196 * @see WP_Widget::form() 197 * 198 * @param array $instance. Previously saved values from database. 199 */ 200 public function form( $instance ) { 201 ?> 202 203 <p> 204 <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'pit' ); ?></label> 205 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>"> 206 </p> 207 208 <p> 209 <label for="<?php echo $this->get_field_id('user'); ?>"><?php _e( 'Pinterest Username:', 'pit' ); ?></label> 210 <input class="widefat" id="<?php echo $this->get_field_id('user'); ?>" name="<?php echo $this->get_field_name('user'); ?>" type="text" value="<?php echo esc_attr( $instance['user'] ); ?>"> 211 <br> 212 <small>http://www.pinterest.com/<strong>username</strong>/boardname/</small> 213 </p> 214 215 <p> 216 <label for="<?php echo $this->get_field_id('board'); ?>"><?php _e( 'Board:', 'pit' ); ?></label> 217 <input class="widefat" id="<?php echo $this->get_field_id('board'); ?>" name="<?php echo $this->get_field_name('board'); ?>" type="text" value="<?php echo esc_attr( $instance['board'] ); ?>"> 218 <br> 219 <small>http://www.pinterest.com/username/<strong>boardname</strong>/</small> 220 </p> 221 222 <p> 223 <label for="<?php echo $this->get_field_id('image_width'); ?>"><?php _e( 'Image Width:', 'pit' ); ?></label> 224 <input class="widefat pit-image-width" id="<?php echo $this->get_field_id('image_width'); ?>" name="<?php echo $this->get_field_name('image_width'); ?>" type="text" value="<?php echo esc_attr( $instance['image_width'] ); ?>"> 225 <br> 226 <small><?php _e( 'min: 60; leave 0 or blank for 92', 'pit' ); ?></small> 227 </p> 228 229 <p> 230 <label for="<?php echo $this->get_field_id('height'); ?>"><?php _e( 'Board Height:', 'pit' ); ?></label> 231 <input class="widefat pit-height" id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo esc_attr( $instance['height'] ); ?>"> 232 <br> 233 <small><?php _e( 'min: 60; leave 0 or blank for 175', 'pit' ); ?></small> 234 </p> 235 236 <p> 237 <label for="<?php echo $this->get_field_id('width'); ?>"><?php _e( 'Board Width:', 'pit' ); ?></label> 238 <input class="widefat pit-width" id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo esc_attr( $instance['width'] ); ?>"> 239 <br> 240 <small><?php _e( 'min: 130; leave 0 or blank for auto', 'pit' ); ?></small> 241 </p> 242 243 <?php 244 } 245 246 /** 247 * Sanitize widget form values as they are saved. 248 * 249 * @see WP_Widget::update() 250 * 251 * @param array $new_instance. Values just sent to be saved. 252 * @param array $old_instance. Previously saved values from database. 253 */ 254 public function update( $new_instance, $old_instance ) { 255 $instance = $old_instance; 256 $instance['title'] = $new_instance['title']; 257 $instance['user'] = $new_instance['user']; 258 $instance['board'] = $new_instance['board']; 259 $instance['image_width'] = intval($new_instance['image_width']); 260 $instance['height'] = intval($new_instance['height']); 261 $instance['width'] = intval($new_instance['width']); 262 263 return $instance; 264 } 265 } 266 267 /** 268 * Pinterest Pin Widget Class 269 * 270 * @since 0.3 271 */ 272 class pit_widget_pin extends WP_Widget { 273 // Constructor 274 function __construct() { 275 parent::__construct( 276 'pit_widget_pin', // Base ID 277 __( 'Pinterest Pin Widget', 'pit' ), // Name 278 array( 'description' => __( 'Embed one of your pins on your site.', 'pit' ) ) // Args 279 ); 280 } 281 282 /** 283 * Front-end display of widget 284 * 285 * @see WP_Widget::widget() 286 * 287 * @param array $args. Widget arguments. 288 * @param rray $instance. Saved values from database. 289 */ 290 public function widget( $args, $instance ) { 291 $title = apply_filters( 'widget_title', $instance['title'] ); 292 $id = $instance['id']; 293 294 echo $args['before_widget']; 295 if ( ! empty( $title ) ) 296 echo $args['before_title'] . $title . $args['after_title']; 297 298 if ( ! empty( $id ) ) 299 echo '<a data-pin-do="embedPin" href="http://www.pinterest.com/pin/' . $id . '/"></a>'; 300 301 echo $args['after_widget']; 302 } 303 304 /** 305 * Back-end widget form. 306 * 307 * @see WP_Widget::form() 308 * 309 * @param array $instance. Previously saved values from database. 310 */ 311 public function form( $instance ) { 312 ?> 313 314 <p> 315 <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'pit' ); ?></label> 316 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>"> 317 </p> 318 319 <p> 320 <label for="<?php echo $this->get_field_id('id'); ?>"><?php _e( 'Pin ID:', 'pit' ); ?></label> 321 <input class="widefat" id="<?php echo $this->get_field_id('id'); ?>" name="<?php echo $this->get_field_name('id'); ?>" type="text" value="<?php echo esc_attr( $instance['id'] ); ?>"> 322 <br> 323 <small>http://www.pinterest.com/pin/<strong>pin_id</strong>/</small> 324 </p> 325 326 <?php 327 } 328 329 /** 330 * Sanitize widget form values as they are saved. 331 * 332 * @see WP_Widget::update() 333 * 334 * @param array $new_instance. Values just sent to be saved. 335 * @param array $old_instance. Previously saved values from database. 336 */ 337 public function update( $new_instance, $old_instance ) { 338 $instance = $old_instance; 339 $instance['title'] = $new_instance['title']; 340 $instance['id'] = $new_instance['id']; 341 342 return $instance; 343 } 344 } 345 346 /** 347 * Register widgets 348 */ 141 349 function pit_register_widget() { 142 350 register_widget('pit_widget_profile'); 351 register_widget('pit_widget_board'); 352 register_widget('pit_widget_pin'); 143 353 } 144 354 add_action( 'widgets_init', 'pit_register_widget' ); -
pinit/tags/0.3/readme.txt
r795787 r795804 4 4 Tags: widget, pinterest 5 5 Requires at least: 2.8 6 Tested up to: 3.7 7 Stable tag: 0. 16 Tested up to: 3.7.1 7 Stable tag: 0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.txt 10 10 11 Handy plugin that adds Pinterest P rofile Widget.11 Handy plugin that adds Pinterest Pin Widget, Profile Widget and Board Widget to your WordPress site. 12 12 13 13 == Description == … … 16 16 17 17 Features include: 18 * Profile Widget19 18 20 Will support other resources soon. 19 * Pin Widget 20 * Profile Widget 21 * Board Widget 22 23 Languages: 24 25 * English 26 * Italian 21 27 22 28 == Installation == … … 38 44 == Changelog == 39 45 46 = 0.3 = 47 * Feature: Pin Widget 48 49 = 0.2 = 50 * Feature: Board Widget 51 40 52 = 0.1 = 41 53 * Feature: Profile Widget 42 54 43 55 == Upgrade Notice == 56 57 New features: Board and Pin Widgets. -
pinit/trunk/languages/it_IT.po
r795787 r795804 2 2 msgstr "" 3 3 "Project-Id-Version: Pinit\n" 4 "POT-Creation-Date: 2013-10-28 1 4:52+0100\n"5 "PO-Revision-Date: 2013-10-28 1 4:56+0100\n"4 "POT-Creation-Date: 2013-10-28 15:48+0100\n" 5 "PO-Revision-Date: 2013-10-28 15:49+0100\n" 6 6 "Last-Translator: Mattia Migliorini <[email protected]>\n" 7 7 "Language-Team: Mattia Migliorini <[email protected]>\n" … … 16 16 #: ../pinit.php:34 17 17 msgid "Pinterest Profile Widget" 18 msgstr " Pinterest Widget Profilo"18 msgstr "Widget Profilo Pinterest" 19 19 20 20 #: ../pinit.php:35 21 msgid "" 22 "Pinterest Profile Widget: show up to 30 of your latest pins on your site." 23 msgstr "" 24 "Pinterest Widget Profilo: mostra fino a 30 dei tuoi pin recenti nel tuo sito." 21 msgid "Show up to 30 of your latest pins on your site." 22 msgstr "Mostra fino a 30 dei tuoi pin recenti nel tuo sito." 25 23 26 #: ../pinit.php:86 24 #: ../pinit.php:86 ../pinit.php:203 27 25 msgid "Title:" 28 26 msgstr "Titolo:" 29 27 30 #: ../pinit.php:91 28 #: ../pinit.php:91 ../pinit.php:208 31 29 msgid "Pinterest User URL:" 32 30 msgstr "URL Profilo Pinterest:" 33 31 34 #: ../pinit.php:98 32 #: ../pinit.php:98 ../pinit.php:215 35 33 msgid "Image Width:" 36 34 msgstr "Larghezza immagine:" 37 35 38 #: ../pinit.php:101 39 msgid "min: 60; leave 0 for 92"40 msgstr "min: 60; lasciare 0 per 92"36 #: ../pinit.php:101 ../pinit.php:218 37 msgid "min: 60; leave 0 or blank for 92" 38 msgstr "min: 60; lasciare 0 o vuoto per 92" 41 39 42 #: ../pinit.php:105 40 #: ../pinit.php:105 ../pinit.php:222 43 41 msgid "Board Height:" 44 msgstr "Altezza widget:"42 msgstr "Altezza bacheca:" 45 43 46 #: ../pinit.php:108 47 msgid "min: 60; leave 0 for 175"48 msgstr "min: 60; lasciare 0 per 175"44 #: ../pinit.php:108 ../pinit.php:225 45 msgid "min: 60; leave 0 or blank for 175" 46 msgstr "min: 60; lasciare 0 o vuoto per 175" 49 47 50 #: ../pinit.php:112 48 #: ../pinit.php:112 ../pinit.php:229 51 49 msgid "Board Width:" 52 msgstr "Larghezza widget:"50 msgstr "Larghezza bacheca:" 53 51 54 #: ../pinit.php:115 55 msgid "min: 130; leave 0 for auto" 56 msgstr "min: 130; lasciare 0 per auto" 52 #: ../pinit.php:115 ../pinit.php:232 53 msgid "min: 130; leave 0 or blank for auto" 54 msgstr "min: 130; lasciare 0 o vuoto per auto" 55 56 #: ../pinit.php:151 57 msgid "Pinterest Board Widget" 58 msgstr "Widget Bacheca Pinterest" 59 60 #: ../pinit.php:152 61 msgid "Show up to 30 of your favorite board's latest pins." 62 msgstr "Mostra fino a 30 dei pin recenti dalla tua bacheca preferita." -
pinit/trunk/pinit.php
r795787 r795804 5 5 * Description: Handy plugin that adds Pinterest Follow Button, Pin Widget, Profile Widget and Board Widget to your WordPress site. 6 6 * Author: Mattia Migliorini 7 * Version: 0. 17 * Version: 0.3 8 8 * Author URI: http://www.deshack.net 9 9 * License: GPLv2 or later … … 33 33 'pit_widget_profile', // Base ID 34 34 __( 'Pinterest Profile Widget', 'pit' ), // Name 35 array( 'description' => __( ' Pinterest Profile Widget: show up to 30 of your latest pins on your site.', 'pit' ) ) // Args35 array( 'description' => __( 'Show up to 30 of your latest pins on your site.', 'pit' ) ) // Args 36 36 ); 37 37 } … … 47 47 public function widget( $args, $instance ) { 48 48 $title = apply_filters( 'widget_title', $instance['title'] ); 49 $u rl = $instance['url'];49 $user = $instance['user']; 50 50 $image_width = $instance['image_width']; 51 51 $width = $instance['width']; … … 67 67 $data_width = ' data-pin-board-width="' . $width . '"'; 68 68 69 if ( ! empty( $u rl) )70 echo '<a data-pin-do="embedUser" href=" ' . $url . '"' . $data_image_width . $data_height . $data_width . '></a>';69 if ( ! empty( $user ) ) 70 echo '<a data-pin-do="embedUser" href="http://www.pinterest.com/' . $user . '/"' . $data_image_width . $data_height . $data_width . '></a>'; 71 71 72 72 echo $args['after_widget']; … … 89 89 90 90 <p> 91 <label for="<?php echo $this->get_field_id('u rl'); ?>"><?php _e( 'Pinterest User URL:', 'pit' ); ?></label>92 <input class="widefat" id="<?php echo $this->get_field_id('u rl'); ?>" name="<?php echo $this->get_field_name('url'); ?>" type="text" value="<?php echo esc_attr( $instance['url'] ); ?>">93 <br> 94 <small>http://www.pinterest.com/ username/</small>91 <label for="<?php echo $this->get_field_id('user'); ?>"><?php _e( 'Pinterest Username:', 'pit' ); ?></label> 92 <input class="widefat" id="<?php echo $this->get_field_id('user'); ?>" name="<?php echo $this->get_field_name('user'); ?>" type="text" value="<?php echo esc_attr( $instance['user'] ); ?>"> 93 <br> 94 <small>http://www.pinterest.com/<strong>username</strong>/</small> 95 95 </p> 96 96 97 97 <p> 98 98 <label for="<?php echo $this->get_field_id('image_width'); ?>"><?php _e( 'Image Width:', 'pit' ); ?></label> 99 <input class="widefat " id="<?php echo $this->get_field_id('image_width'); ?>" name="<?php echo $this->get_field_name('image_width'); ?>" type="text" value="<?php echo esc_attr( $instance['image_width'] ); ?>">100 <br> 101 <small><?php _e( 'min: 60; leave 0 for 92', 'pit' ); ?></small>99 <input class="widefat pit-image-width" id="<?php echo $this->get_field_id('image_width'); ?>" name="<?php echo $this->get_field_name('image_width'); ?>" type="text" value="<?php echo esc_attr( $instance['image_width'] ); ?>"> 100 <br> 101 <small><?php _e( 'min: 60; leave 0 or blank for 92', 'pit' ); ?></small> 102 102 </p> 103 103 104 104 <p> 105 105 <label for="<?php echo $this->get_field_id('height'); ?>"><?php _e( 'Board Height:', 'pit' ); ?></label> 106 <input class="widefat " id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo esc_attr( $instance['height'] ); ?>">107 <br> 108 <small><?php _e( 'min: 60; leave 0 for 175', 'pit' ); ?></small>106 <input class="widefat pit-height" id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo esc_attr( $instance['height'] ); ?>"> 107 <br> 108 <small><?php _e( 'min: 60; leave 0 or blank for 175', 'pit' ); ?></small> 109 109 </p> 110 110 111 111 <p> 112 112 <label for="<?php echo $this->get_field_id('width'); ?>"><?php _e( 'Board Width:', 'pit' ); ?></label> 113 <input class="widefat " id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo esc_attr( $instance['width'] ); ?>">114 <br> 115 <small><?php _e( 'min: 130; leave 0 for auto', 'pit' ); ?></small>113 <input class="widefat pit-width" id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo esc_attr( $instance['width'] ); ?>"> 114 <br> 115 <small><?php _e( 'min: 130; leave 0 or blank for auto', 'pit' ); ?></small> 116 116 </p> 117 117 … … 130 130 $instance = $old_instance; 131 131 $instance['title'] = $new_instance['title']; 132 $instance['u rl'] = esc_url_raw( $new_instance['url'], array('http', 'https') );132 $instance['user'] = $new_instance['user']; 133 133 $instance['image_width'] = intval($new_instance['image_width']); 134 134 $instance['height'] = intval($new_instance['height']); … … 139 139 } 140 140 141 /** 142 * Pinterest Board Widget Class 143 * 144 * @since 0.2 145 */ 146 class pit_widget_board extends WP_Widget { 147 // Constructor 148 function __construct() { 149 parent::__construct( 150 'pit_widget_board', // Base ID 151 __( 'Pinterest Board Widget', 'pit' ), // Name 152 array( 'description' => __( 'Show up to 30 of your favorite board\'s latest pins.', 'pit' ) ) // Args 153 ); 154 } 155 156 /** 157 * Front-end display of widget. 158 * 159 * @see WP_Widget::widget() 160 * 161 * @param array $args. Widget arguments. 162 * @param array $instance. Saved values from database. 163 */ 164 public function widget( $args, $instance ) { 165 $title = apply_filters( 'widget_title', $instance['title'] ); 166 $user = $instance['user']; 167 $board = $instance['board']; 168 $image_width = $instance['image_width']; 169 $width = $instance['width']; 170 $height = $instance['height']; 171 172 echo $args['before_widget']; 173 if ( ! empty( $title ) ) 174 echo $args['before_title'] . $title . $args['after_title']; 175 176 $data_image_width = ''; 177 $data_width = ''; 178 $data_height = ''; 179 180 if ( ! empty( $image_width ) ) 181 $data_image_width = ' data-pin-scale-width="' . $image_width . '"'; 182 if ( ! empty( $height ) ) 183 $data_height = ' data-pin-scale-height="' . $height . '"'; 184 if ( ! empty( $width ) ) 185 $data_width = ' data-pin-board-width="' . $width . '"'; 186 187 if ( ! empty( $user ) && ! empty( $board ) ) 188 echo '<a data-pin-do="embedBoard" href="http://www.pinterest.com/' . $user . '/' . $board . '/"' . $data_image_width . $data_height . $data_width . '></a>'; 189 190 echo $args['after_widget']; 191 } 192 193 /** 194 * Back-end widget form. 195 * 196 * @see WP_Widget::form() 197 * 198 * @param array $instance. Previously saved values from database. 199 */ 200 public function form( $instance ) { 201 ?> 202 203 <p> 204 <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'pit' ); ?></label> 205 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>"> 206 </p> 207 208 <p> 209 <label for="<?php echo $this->get_field_id('user'); ?>"><?php _e( 'Pinterest Username:', 'pit' ); ?></label> 210 <input class="widefat" id="<?php echo $this->get_field_id('user'); ?>" name="<?php echo $this->get_field_name('user'); ?>" type="text" value="<?php echo esc_attr( $instance['user'] ); ?>"> 211 <br> 212 <small>http://www.pinterest.com/<strong>username</strong>/boardname/</small> 213 </p> 214 215 <p> 216 <label for="<?php echo $this->get_field_id('board'); ?>"><?php _e( 'Board:', 'pit' ); ?></label> 217 <input class="widefat" id="<?php echo $this->get_field_id('board'); ?>" name="<?php echo $this->get_field_name('board'); ?>" type="text" value="<?php echo esc_attr( $instance['board'] ); ?>"> 218 <br> 219 <small>http://www.pinterest.com/username/<strong>boardname</strong>/</small> 220 </p> 221 222 <p> 223 <label for="<?php echo $this->get_field_id('image_width'); ?>"><?php _e( 'Image Width:', 'pit' ); ?></label> 224 <input class="widefat pit-image-width" id="<?php echo $this->get_field_id('image_width'); ?>" name="<?php echo $this->get_field_name('image_width'); ?>" type="text" value="<?php echo esc_attr( $instance['image_width'] ); ?>"> 225 <br> 226 <small><?php _e( 'min: 60; leave 0 or blank for 92', 'pit' ); ?></small> 227 </p> 228 229 <p> 230 <label for="<?php echo $this->get_field_id('height'); ?>"><?php _e( 'Board Height:', 'pit' ); ?></label> 231 <input class="widefat pit-height" id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" type="text" value="<?php echo esc_attr( $instance['height'] ); ?>"> 232 <br> 233 <small><?php _e( 'min: 60; leave 0 or blank for 175', 'pit' ); ?></small> 234 </p> 235 236 <p> 237 <label for="<?php echo $this->get_field_id('width'); ?>"><?php _e( 'Board Width:', 'pit' ); ?></label> 238 <input class="widefat pit-width" id="<?php echo $this->get_field_id('width'); ?>" name="<?php echo $this->get_field_name('width'); ?>" type="text" value="<?php echo esc_attr( $instance['width'] ); ?>"> 239 <br> 240 <small><?php _e( 'min: 130; leave 0 or blank for auto', 'pit' ); ?></small> 241 </p> 242 243 <?php 244 } 245 246 /** 247 * Sanitize widget form values as they are saved. 248 * 249 * @see WP_Widget::update() 250 * 251 * @param array $new_instance. Values just sent to be saved. 252 * @param array $old_instance. Previously saved values from database. 253 */ 254 public function update( $new_instance, $old_instance ) { 255 $instance = $old_instance; 256 $instance['title'] = $new_instance['title']; 257 $instance['user'] = $new_instance['user']; 258 $instance['board'] = $new_instance['board']; 259 $instance['image_width'] = intval($new_instance['image_width']); 260 $instance['height'] = intval($new_instance['height']); 261 $instance['width'] = intval($new_instance['width']); 262 263 return $instance; 264 } 265 } 266 267 /** 268 * Pinterest Pin Widget Class 269 * 270 * @since 0.3 271 */ 272 class pit_widget_pin extends WP_Widget { 273 // Constructor 274 function __construct() { 275 parent::__construct( 276 'pit_widget_pin', // Base ID 277 __( 'Pinterest Pin Widget', 'pit' ), // Name 278 array( 'description' => __( 'Embed one of your pins on your site.', 'pit' ) ) // Args 279 ); 280 } 281 282 /** 283 * Front-end display of widget 284 * 285 * @see WP_Widget::widget() 286 * 287 * @param array $args. Widget arguments. 288 * @param rray $instance. Saved values from database. 289 */ 290 public function widget( $args, $instance ) { 291 $title = apply_filters( 'widget_title', $instance['title'] ); 292 $id = $instance['id']; 293 294 echo $args['before_widget']; 295 if ( ! empty( $title ) ) 296 echo $args['before_title'] . $title . $args['after_title']; 297 298 if ( ! empty( $id ) ) 299 echo '<a data-pin-do="embedPin" href="http://www.pinterest.com/pin/' . $id . '/"></a>'; 300 301 echo $args['after_widget']; 302 } 303 304 /** 305 * Back-end widget form. 306 * 307 * @see WP_Widget::form() 308 * 309 * @param array $instance. Previously saved values from database. 310 */ 311 public function form( $instance ) { 312 ?> 313 314 <p> 315 <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:', 'pit' ); ?></label> 316 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>"> 317 </p> 318 319 <p> 320 <label for="<?php echo $this->get_field_id('id'); ?>"><?php _e( 'Pin ID:', 'pit' ); ?></label> 321 <input class="widefat" id="<?php echo $this->get_field_id('id'); ?>" name="<?php echo $this->get_field_name('id'); ?>" type="text" value="<?php echo esc_attr( $instance['id'] ); ?>"> 322 <br> 323 <small>http://www.pinterest.com/pin/<strong>pin_id</strong>/</small> 324 </p> 325 326 <?php 327 } 328 329 /** 330 * Sanitize widget form values as they are saved. 331 * 332 * @see WP_Widget::update() 333 * 334 * @param array $new_instance. Values just sent to be saved. 335 * @param array $old_instance. Previously saved values from database. 336 */ 337 public function update( $new_instance, $old_instance ) { 338 $instance = $old_instance; 339 $instance['title'] = $new_instance['title']; 340 $instance['id'] = $new_instance['id']; 341 342 return $instance; 343 } 344 } 345 346 /** 347 * Register widgets 348 */ 141 349 function pit_register_widget() { 142 350 register_widget('pit_widget_profile'); 351 register_widget('pit_widget_board'); 352 register_widget('pit_widget_pin'); 143 353 } 144 354 add_action( 'widgets_init', 'pit_register_widget' ); -
pinit/trunk/readme.txt
r795787 r795804 4 4 Tags: widget, pinterest 5 5 Requires at least: 2.8 6 Tested up to: 3.7 7 Stable tag: 0. 16 Tested up to: 3.7.1 7 Stable tag: 0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.txt 10 10 11 Handy plugin that adds Pinterest P rofile Widget.11 Handy plugin that adds Pinterest Pin Widget, Profile Widget and Board Widget to your WordPress site. 12 12 13 13 == Description == … … 16 16 17 17 Features include: 18 * Profile Widget19 18 20 Will support other resources soon. 19 * Pin Widget 20 * Profile Widget 21 * Board Widget 22 23 Languages: 24 25 * English 26 * Italian 21 27 22 28 == Installation == … … 38 44 == Changelog == 39 45 46 = 0.3 = 47 * Feature: Pin Widget 48 49 = 0.2 = 50 * Feature: Board Widget 51 40 52 = 0.1 = 41 53 * Feature: Profile Widget 42 54 43 55 == Upgrade Notice == 56 57 New features: Board and Pin Widgets.
Note: See TracChangeset
for help on using the changeset viewer.