Projects by WooThemes - Version 1.2.1

Version Description

  • 2014-04-24
  • Fix - Javascript error in admin
  • Fix - Select box save method. (Props @anija).
Download this release

Release Info

Developer jameskoster
Plugin Icon wp plugin Projects by WooThemes
Version 1.2.1
Comparing to
See all releases

Code changes from version 1.2.0 to 1.2.1

classes/class-projects-admin.php CHANGED
@@ -482,7 +482,10 @@ class Projects_Admin {
482
  case 'radio':
483
  case 'select':
484
  // whitelist accepted value against options
485
- ${$f} = isset( $_POST[$f] ) && is_array( $field_data[$f]['options'] ) && in_array( $_POST[$f], $field_data[$f]['options'] ) ? $_POST[$f] : '';
 
 
 
486
  break;
487
  default :
488
  ${$f} = isset( $_POST[$f] ) ? strip_tags( trim( $_POST[$f] ) ) : '';
@@ -550,13 +553,18 @@ class Projects_Admin {
550
  * @return void
551
  */
552
  public function enqueue_admin_styles () {
 
 
553
  wp_enqueue_style( 'projects-admin', $this->assets_url . '/css/admin.css', array(), '1.0.0' );
554
- wp_enqueue_script( 'projects-admin', $this->assets_url . '/js/admin.js', array( 'jquery', 'media-editor' ), '1.0.0', true );
 
 
 
555
 
556
  wp_localize_script( 'projects-admin', 'woo_projects_admin',
557
  array(
558
  'gallery_title' => __( 'Add Images to Project Gallery', 'projects-by-woothemes' ),
559
- 'gallery_button' => __( 'Add to gallery', 'projects-by-woothemes' ),
560
  'delete_image' => __( 'Delete image', 'projects-by-woothemes' ),
561
  'default_title' => __( 'Upload', 'projects-by-woothemes' ),
562
  'default_button' => __( 'Select this', 'projects-by-woothemes' ),
482
  case 'radio':
483
  case 'select':
484
  // whitelist accepted value against options
485
+ $values = array();
486
+ if ( is_array( $field_data[$f]['options'] ) )
487
+ $values = array_keys( $field_data[$f]['options'] );
488
+ ${$f} = isset( $_POST[$f] ) && in_array( $_POST[$f], $values ) ? $_POST[$f] : '';
489
  break;
490
  default :
491
  ${$f} = isset( $_POST[$f] ) ? strip_tags( trim( $_POST[$f] ) ) : '';
553
  * @return void
554
  */
555
  public function enqueue_admin_styles () {
556
+ global $pagenow;
557
+
558
  wp_enqueue_style( 'projects-admin', $this->assets_url . '/css/admin.css', array(), '1.0.0' );
559
+
560
+ if ( $pagenow == 'post.php' && get_post_type() == $this->post_type ) {
561
+ wp_enqueue_script( 'projects-admin', $this->assets_url . '/js/admin.js', array( 'jquery' ), '1.0.0', true );
562
+ }
563
 
564
  wp_localize_script( 'projects-admin', 'woo_projects_admin',
565
  array(
566
  'gallery_title' => __( 'Add Images to Project Gallery', 'projects-by-woothemes' ),
567
+ 'gallery_button' => __( 'Add to gallery', 'projects-by-woothemes' ),
568
  'delete_image' => __( 'Delete image', 'projects-by-woothemes' ),
569
  'default_title' => __( 'Upload', 'projects-by-woothemes' ),
570
  'default_button' => __( 'Select this', 'projects-by-woothemes' ),
classes/class-projects.php CHANGED
@@ -207,7 +207,7 @@ class Projects {
207
 
208
  // Register each image size
209
  foreach ( $options as $image_size => $size ) {
210
- $crop = isset( $size['crop'] ) & 'yes' == $size['crop'] ? true : false;
211
  add_image_size( $image_size, $size['width'], $size['height'], $crop );
212
  }
213
 
207
 
208
  // Register each image size
209
  foreach ( $options as $image_size => $size ) {
210
+ $crop = isset( $size['crop'] ) && 'yes' == $size['crop'] ? true : false;
211
  add_image_size( $image_size, $size['width'], $size['height'], $crop );
212
  }
213
 
projects.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: http://woothemes.com/
5
  * Description: Hi, I'm your project showcase plugin for WordPress. Show off your recent work using our shortcode, widget or template tag.
6
  * Author: WooThemes
7
- * Version: 1.2.0
8
  * Author URI: http://woothemes.com/
9
  *
10
  * @package WordPress
4
  * Plugin URI: http://woothemes.com/
5
  * Description: Hi, I'm your project showcase plugin for WordPress. Show off your recent work using our shortcode, widget or template tag.
6
  * Author: WooThemes
7
+ * Version: 1.2.1
8
  * Author URI: http://woothemes.com/
9
  *
10
  * @package WordPress
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://woothemes.com/
4
  Tags: portfolio, projects, project, showcase, artwork, work, creative, photography, art, images
5
  Requires at least: 3.8
6
  Tested up to: 3.8.1
7
- Stable tag: 1.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -109,6 +109,11 @@ You sure can! Read about how in the [documentation](http://docs.woothemes.com/do
109
 
110
  == Changelog ==
111
 
 
 
 
 
 
112
  = 1.2.0 =
113
  * 2014-04-09
114
  * New - Replaced .less files with .scss.
4
  Tags: portfolio, projects, project, showcase, artwork, work, creative, photography, art, images
5
  Requires at least: 3.8
6
  Tested up to: 3.8.1
7
+ Stable tag: 1.2.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
109
 
110
  == Changelog ==
111
 
112
+ = 1.2.1 =
113
+ * 2014-04-24
114
+ * Fix - Javascript error in admin
115
+ * Fix - Select box save method. (Props @anija).
116
+
117
  = 1.2.0 =
118
  * 2014-04-09
119
  * New - Replaced .less files with .scss.