Attachments - Version 1.5.1.2

Version Description

  • Fixed bug with handling legacy Attachments data store
  • Updated localization hook for options screen
Download this release

Release Info

Developer jchristopher
Plugin Icon wp plugin Attachments
Version 1.5.1.2
Comparing to
See all releases

Code changes from version 1.5.1.1 to 1.5.1.2

Files changed (3) hide show
  1. attachments.options.php +45 -45
  2. attachments.php +5 -2
  3. readme.txt +7 -3
attachments.options.php CHANGED
@@ -1,47 +1,47 @@
1
  <div class="wrap">
2
- <div id="icon-options-general" class="icon32"><br /></div>
3
- <h2>Attachments Options</h2>
4
- <form action="options.php" method="post">
5
- <?php wp_nonce_field('update-options'); ?>
6
-
7
- <?php if( function_exists( 'get_post_types' ) ) : ?>
8
-
9
- <?php
10
- $args = array(
11
- 'public' => true,
12
- '_builtin' => false
13
- );
14
- $output = 'objects';
15
- $operator = 'and';
16
- $post_types = get_post_types( $args, $output, $operator );
17
- ?>
18
-
19
- <?php if( count( $post_types ) ) : ?>
20
-
21
- <h3><?php _e("Custom Post Type Settings", "attachments"); ?></h3>
22
- <p><?php _e("Include Attachments in the following Custom Post Types:", "attachments"); ?></p>
23
- <?php foreach($post_types as $post_type) : ?>
24
-
25
- <div class="attachments_checkbox">
26
- <input type="checkbox" name="attachments_cpt_<?php echo $post_type->name; ?>" id="attachments_cpt_<?php echo $post_type->name; ?>" value="true"<?php if (get_option('attachments_cpt_' . $post_type->name)=='true') : ?> checked="checked"<?php endif ?> />
27
- <label for="attachments_cpt_<?php echo $post_type->name; ?>"><?php echo $post_type->labels->name; ?></label>
28
- </div>
29
-
30
- <?php endforeach ?>
31
-
32
- <input type="hidden" name="action" value="update" />
33
- <input type="hidden" name="page_options" value="attachments_limit_to_user,<?php if( !empty( $post_types ) ) : foreach( $post_types as $post_type ) : ?>attachments_cpt_<?php echo $post_type->name; ?>,<?php endforeach; endif; ?>" />
34
- <p class="submit">
35
- <input type="submit" class="button-primary" value="<?php _e("Save", "attachments");?>" />
36
- </p>
37
-
38
- <?php else: ?>
39
-
40
- <?php _e("<p>Attachments can be integrated with your Custom Post Types. Unfortunately, there are none to work with at this time.</p>"); ?>
41
-
42
- <?php endif ?>
43
-
44
- <?php endif ?>
45
-
46
- </form>
47
  </div>
1
  <div class="wrap">
2
+ <div id="icon-options-general" class="icon32"><br /></div>
3
+ <h2>Attachments Options</h2>
4
+ <form action="options.php" method="post">
5
+ <?php wp_nonce_field('update-options'); ?>
6
+
7
+ <?php if( function_exists( 'get_post_types' ) ) : ?>
8
+
9
+ <?php
10
+ $args = array(
11
+ 'public' => true,
12
+ '_builtin' => false
13
+ );
14
+ $output = 'objects';
15
+ $operator = 'and';
16
+ $post_types = get_post_types( $args, $output, $operator );
17
+ ?>
18
+
19
+ <?php if( count( $post_types ) ) : ?>
20
+
21
+ <h3><?php _e("Custom Post Type Settings", "attachments"); ?></h3>
22
+ <p><?php _e("Include Attachments in the following Custom Post Types:", "attachments"); ?></p>
23
+ <?php foreach($post_types as $post_type) : ?>
24
+
25
+ <div class="attachments_checkbox">
26
+ <input type="checkbox" name="attachments_cpt_<?php echo $post_type->name; ?>" id="attachments_cpt_<?php echo $post_type->name; ?>" value="true"<?php if (get_option('attachments_cpt_' . $post_type->name)=='true') : ?> checked="checked"<?php endif ?> />
27
+ <label for="attachments_cpt_<?php echo $post_type->name; ?>"><?php echo $post_type->labels->name; ?></label>
28
+ </div>
29
+
30
+ <?php endforeach ?>
31
+
32
+ <input type="hidden" name="action" value="update" />
33
+ <input type="hidden" name="page_options" value="attachments_limit_to_user,<?php if( !empty( $post_types ) ) : foreach( $post_types as $post_type ) : ?>attachments_cpt_<?php echo $post_type->name; ?>,<?php endforeach; endif; ?>" />
34
+ <p class="submit">
35
+ <input type="submit" class="button-primary" value="<?php _e("Save", "attachments");?>" />
36
+ </p>
37
+
38
+ <?php else: ?>
39
+
40
+ <p><?php _e('Attachments can be integrated with your Custom Post Types. Unfortunately, there are none to work with at this time.', 'attachments'); ?></p>
41
+
42
+ <?php endif ?>
43
+
44
+ <?php endif ?>
45
+
46
+ </form>
47
  </div>
attachments.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Attachments
4
  Plugin URI: http://mondaybynoon.com/wordpress-attachments/
5
  Description: Attachments gives the ability to append any number of Media Library items to Pages, Posts, and Custom Post Types
6
- Version: 1.5.1.1
7
  Author: Jonathan Christopher
8
  Author URI: http://mondaybynoon.com/
9
  */
@@ -359,7 +359,10 @@ function attachments_get_attachments( $post_id=null )
359
  // get all attachments
360
  $existing_attachments = get_post_meta( $post_id, '_attachments', false );
361
 
362
- $legacy_existing_attachments = unserialize( $existing_attachments[0] );
 
 
 
363
 
364
  // Check for legacy attachments
365
  if( is_array( $legacy_existing_attachments ) )
3
  Plugin Name: Attachments
4
  Plugin URI: http://mondaybynoon.com/wordpress-attachments/
5
  Description: Attachments gives the ability to append any number of Media Library items to Pages, Posts, and Custom Post Types
6
+ Version: 1.5.1.2
7
  Author: Jonathan Christopher
8
  Author URI: http://mondaybynoon.com/
9
  */
359
  // get all attachments
360
  $existing_attachments = get_post_meta( $post_id, '_attachments', false );
361
 
362
+ if( !empty( $existing_attachments ) )
363
+ {
364
+ $legacy_existing_attachments = unserialize( $existing_attachments[0] );
365
+ }
366
 
367
  // Check for legacy attachments
368
  if( is_array( $legacy_existing_attachments ) )
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: jchristopher
3
  Donate link: http://mondaybynoon.com/donate/
4
  Tags: post, page, posts, pages, images, PDF, doc, Word, image, jpg, jpeg, picture, pictures, photos, attachment
5
- Requires at least: 2.8
6
- Tested up to: 3.0.1
7
- Stable tag: 1.5.1.1
8
 
9
  Attachments allows you to simply append any number of items from your WordPress Media Library to Posts, Pages, and Custom Post Types
10
 
@@ -44,6 +44,10 @@ Attachments uses WordPress' built in Media library for uploads and storage.
44
 
45
  == Changelog ==
46
 
 
 
 
 
47
  = 1.5.1.1 =
48
  * Fixed JS var naming error in IE
49
  * Hid NextGen tab in browser
2
  Contributors: jchristopher
3
  Donate link: http://mondaybynoon.com/donate/
4
  Tags: post, page, posts, pages, images, PDF, doc, Word, image, jpg, jpeg, picture, pictures, photos, attachment
5
+ Requires at least: 3.0
6
+ Tested up to: 3.1
7
+ Stable tag: 1.5.1.2
8
 
9
  Attachments allows you to simply append any number of items from your WordPress Media Library to Posts, Pages, and Custom Post Types
10
 
44
 
45
  == Changelog ==
46
 
47
+ = 1.5.1.2 =
48
+ * Fixed bug with handling legacy Attachments data store
49
+ * Updated localization hook for options screen
50
+
51
  = 1.5.1.1 =
52
  * Fixed JS var naming error in IE
53
  * Hid NextGen tab in browser