Version Description
- Fixed a PHP Warning when activated using Multisite
- Slightly modified the migration process to better handle plugins like WPML (props sebastian.friedrich)
Download this release
Release Info
| Developer | jchristopher |
| Plugin | |
| Version | 3.3.3 |
| Comparing to | |
| See all releases | |
Code changes from version 3.3.2 to 3.3.3
- README.md +6 -2
- classes/class.attachments.migrate.php +2 -1
- classes/class.attachments.php +8 -6
- index.php +2 -2
- readme.txt +8 -4
README.md
CHANGED
|
@@ -29,7 +29,7 @@ Attachments allows you to simply append any number of items from your WordPress
|
|
| 29 |
|
| 30 |
### Updated for WordPress 3.5!
|
| 31 |
|
| 32 |
-
WordPress 3.5 ships with an amazing new Media workflow and Attachments 3.0 makes great use of it. *If you are not running WordPress 3.5, version 1.6.2.1 will be used until you upgrade to WordPress 3.5
|
| 33 |
|
| 34 |
### Associate Media items with posts
|
| 35 |
|
|
@@ -74,7 +74,7 @@ That snippet will request all of the existing Attachments defined for the curren
|
|
| 74 |
## Upgrade Notice
|
| 75 |
|
| 76 |
#### 3.0
|
| 77 |
-
**You will need to update your theme files that use Attachments 3.0**. Version 1.x of Attachments has been
|
| 78 |
|
| 79 |
```php
|
| 80 |
define( 'ATTACHMENTS_LEGACY', true ); // force the legacy version of Attachments
|
|
@@ -419,6 +419,10 @@ Attachments uses WordPress' built in Media library for uploads and storage.
|
|
| 419 |
|
| 420 |
<dl>
|
| 421 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 422 |
<dt>3.3.2</dt>
|
| 423 |
<dd>You can now specify which view is default when browsing the Media modal (e.g. have 'Upload Files' be default instead of 'Media Library')</dd>
|
| 424 |
|
| 29 |
|
| 30 |
### Updated for WordPress 3.5!
|
| 31 |
|
| 32 |
+
WordPress 3.5 ships with an amazing new Media workflow and Attachments 3.0 makes great use of it. *If you are not running WordPress 3.5, the (now deprecated) version 1.6.2.1 (included with Attachments 3.x) will be used until you upgrade to WordPress 3.5+*
|
| 33 |
|
| 34 |
### Associate Media items with posts
|
| 35 |
|
| 74 |
## Upgrade Notice
|
| 75 |
|
| 76 |
#### 3.0
|
| 77 |
+
**You will need to update your theme files that use Attachments 3.0**. Version 1.x of Attachments has been **fully deprecated** but is still available *and included with Attachments 3.x*. If you would like to continue to use the (no longer supported) 1.x version you may add the following to your `wp-config.php`:
|
| 78 |
|
| 79 |
```php
|
| 80 |
define( 'ATTACHMENTS_LEGACY', true ); // force the legacy version of Attachments
|
| 419 |
|
| 420 |
<dl>
|
| 421 |
|
| 422 |
+
<dt>3.3.3</dt>
|
| 423 |
+
<dd>Fixed a PHP Warning when activated using Multisite</dd>
|
| 424 |
+
<dd>Slightly modified the migration process to better handle plugins like WPML (props sebastian.friedrich)</dd>
|
| 425 |
+
|
| 426 |
<dt>3.3.2</dt>
|
| 427 |
<dd>You can now specify which view is default when browsing the Media modal (e.g. have 'Upload Files' be default instead of 'Media Library')</dd>
|
| 428 |
|
classes/class.attachments.migrate.php
CHANGED
|
@@ -52,6 +52,7 @@ class AttachmentsMigrate extends Attachments
|
|
| 52 |
'post_status' => 'any',
|
| 53 |
'posts_per_page' => -1,
|
| 54 |
'meta_key' => '_attachments',
|
|
|
|
| 55 |
);
|
| 56 |
|
| 57 |
$query = new WP_Query( $args );
|
|
@@ -231,4 +232,4 @@ class AttachmentsMigrate extends Attachments
|
|
| 231 |
add_option( 'attachments_migrated', true, '', 'no' );
|
| 232 |
}
|
| 233 |
|
| 234 |
-
}
|
| 52 |
'post_status' => 'any',
|
| 53 |
'posts_per_page' => -1,
|
| 54 |
'meta_key' => '_attachments',
|
| 55 |
+
'suppress_filters' => true,
|
| 56 |
);
|
| 57 |
|
| 58 |
$query = new WP_Query( $args );
|
| 232 |
add_option( 'attachments_migrated', true, '', 'no' );
|
| 233 |
}
|
| 234 |
|
| 235 |
+
}
|
classes/class.attachments.php
CHANGED
|
@@ -59,7 +59,7 @@ if ( !class_exists( 'Attachments' ) ) :
|
|
| 59 |
|
| 60 |
// establish our environment variables
|
| 61 |
|
| 62 |
-
$this->version = '3.3.
|
| 63 |
$this->url = ATTACHMENTS_URL;
|
| 64 |
$this->dir = ATTACHMENTS_DIR;
|
| 65 |
|
|
@@ -131,10 +131,11 @@ if ( !class_exists( 'Attachments' ) ) :
|
|
| 131 |
|
| 132 |
// set up our WP_Query args to grab anything with legacy data
|
| 133 |
$args = array(
|
| 134 |
-
'post_type' => isset( $post_types ) ? $post_types : array(),
|
| 135 |
'post_status' => 'any',
|
| 136 |
'posts_per_page' => 1,
|
| 137 |
'meta_key' => '_attachments',
|
|
|
|
| 138 |
);
|
| 139 |
|
| 140 |
$legacy = new WP_Query( $args );
|
|
@@ -145,12 +146,15 @@ if ( !class_exists( 'Attachments' ) ) :
|
|
| 145 |
// deal with our legacy Pro issues if the user hasn't dismissed or migrated already
|
| 146 |
if( false == get_option( 'attachments_pro_migrated' ) && false == get_option( 'attachments_pro_ignore_migration' ) )
|
| 147 |
{
|
|
|
|
|
|
|
| 148 |
// set up our WP_Query args to grab anything (really anything) with legacy data
|
| 149 |
$args = array(
|
| 150 |
-
'post_type' =>
|
| 151 |
'post_status' => 'any',
|
| 152 |
'posts_per_page' => 1,
|
| 153 |
'meta_key' => '_attachments_pro',
|
|
|
|
| 154 |
);
|
| 155 |
|
| 156 |
$legacy_pro = new WP_Query( $args );
|
|
@@ -686,9 +690,7 @@ if ( !class_exists( 'Attachments' ) ) :
|
|
| 686 |
button: {
|
| 687 |
// Set the text of the button.
|
| 688 |
text: button
|
| 689 |
-
}
|
| 690 |
-
|
| 691 |
-
router: 'upload'
|
| 692 |
});
|
| 693 |
|
| 694 |
// set up our select handler
|
| 59 |
|
| 60 |
// establish our environment variables
|
| 61 |
|
| 62 |
+
$this->version = '3.3.3';
|
| 63 |
$this->url = ATTACHMENTS_URL;
|
| 64 |
$this->dir = ATTACHMENTS_DIR;
|
| 65 |
|
| 131 |
|
| 132 |
// set up our WP_Query args to grab anything with legacy data
|
| 133 |
$args = array(
|
| 134 |
+
'post_type' => isset( $post_types ) ? $post_types : array( 'post', 'page' ),
|
| 135 |
'post_status' => 'any',
|
| 136 |
'posts_per_page' => 1,
|
| 137 |
'meta_key' => '_attachments',
|
| 138 |
+
'suppress_filters' => true,
|
| 139 |
);
|
| 140 |
|
| 141 |
$legacy = new WP_Query( $args );
|
| 146 |
// deal with our legacy Pro issues if the user hasn't dismissed or migrated already
|
| 147 |
if( false == get_option( 'attachments_pro_migrated' ) && false == get_option( 'attachments_pro_ignore_migration' ) )
|
| 148 |
{
|
| 149 |
+
$post_types = get_post_types();
|
| 150 |
+
|
| 151 |
// set up our WP_Query args to grab anything (really anything) with legacy data
|
| 152 |
$args = array(
|
| 153 |
+
'post_type' => !empty( $post_types ) ? $post_types : array( 'post', 'page' ),
|
| 154 |
'post_status' => 'any',
|
| 155 |
'posts_per_page' => 1,
|
| 156 |
'meta_key' => '_attachments_pro',
|
| 157 |
+
'suppress_filters' => true,
|
| 158 |
);
|
| 159 |
|
| 160 |
$legacy_pro = new WP_Query( $args );
|
| 690 |
button: {
|
| 691 |
// Set the text of the button.
|
| 692 |
text: button
|
| 693 |
+
}
|
|
|
|
|
|
|
| 694 |
});
|
| 695 |
|
| 696 |
// set up our select handler
|
index.php
CHANGED
|
@@ -6,7 +6,7 @@
|
|
| 6 |
* Description: Attachments gives the ability to append any number of Media Library items to Pages, Posts, and Custom Post Types
|
| 7 |
* Author: Jonathan Christopher
|
| 8 |
* Author URI: http://mondaybynoon.com/
|
| 9 |
-
* Version: 3.3.
|
| 10 |
* Text Domain: attachments
|
| 11 |
* Domain Path: /languages/
|
| 12 |
* License: GPLv2 or later
|
|
@@ -39,7 +39,7 @@ else
|
|
| 39 |
else
|
| 40 |
{
|
| 41 |
define( 'ATTACHMENTS_DIR', plugin_dir_path( __FILE__ ) );
|
| 42 |
-
define( 'ATTACHMENTS_URL',
|
| 43 |
|
| 44 |
// load current version of Attachments
|
| 45 |
require_once 'classes/class.attachments.php';
|
| 6 |
* Description: Attachments gives the ability to append any number of Media Library items to Pages, Posts, and Custom Post Types
|
| 7 |
* Author: Jonathan Christopher
|
| 8 |
* Author URI: http://mondaybynoon.com/
|
| 9 |
+
* Version: 3.3.3
|
| 10 |
* Text Domain: attachments
|
| 11 |
* Domain Path: /languages/
|
| 12 |
* License: GPLv2 or later
|
| 39 |
else
|
| 40 |
{
|
| 41 |
define( 'ATTACHMENTS_DIR', plugin_dir_path( __FILE__ ) );
|
| 42 |
+
define( 'ATTACHMENTS_URL', plugins_url( 'attachments' ) );
|
| 43 |
|
| 44 |
// load current version of Attachments
|
| 45 |
require_once 'classes/class.attachments.php';
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ 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.5.1
|
| 7 |
-
Stable tag: 3.3.
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
|
@@ -16,7 +16,7 @@ Attachments allows you to simply append any number of items from your WordPress
|
|
| 16 |
|
| 17 |
= Updated for WordPress 3.5! =
|
| 18 |
|
| 19 |
-
WordPress 3.5 ships with an amazing new Media workflow and Attachments 3.0 makes great use of it. *If you are not running WordPress 3.5, version 1.6.2.1 will be used until you upgrade to WordPress 3.5
|
| 20 |
|
| 21 |
= Associate Media items with posts =
|
| 22 |
|
|
@@ -61,7 +61,7 @@ There is a lot more information on [Attachments' GitHub page](https://github.com
|
|
| 61 |
|
| 62 |
= Upgrading from version 1.x =
|
| 63 |
|
| 64 |
-
**You will need to update your theme files that use Attachments 3.0**. Version 1.x of Attachments has been
|
| 65 |
|
| 66 |
`define( 'ATTACHMENTS_LEGACY', true ); // force the legacy version of Attachments`
|
| 67 |
|
|
@@ -107,6 +107,10 @@ Else: please reference the **Installation > Upgrade Notice** details.
|
|
| 107 |
|
| 108 |
== Changelog ==
|
| 109 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 110 |
= 3.3.2 =
|
| 111 |
* You can now specify which view is default when browsing the Media modal (e.g. have 'Upload Files' be default instead of 'Media Library')
|
| 112 |
|
|
@@ -624,4 +628,4 @@ The full list of available search arguments (and their defaults) is as follows:
|
|
| 624 |
);
|
| 625 |
?>`
|
| 626 |
|
| 627 |
-
Once you've performed your search, you can loop through the returned Attachments as you normally would.
|
| 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.5.1
|
| 7 |
+
Stable tag: 3.3.3
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
| 16 |
|
| 17 |
= Updated for WordPress 3.5! =
|
| 18 |
|
| 19 |
+
WordPress 3.5 ships with an amazing new Media workflow and Attachments 3.0 makes great use of it. *If you are not running WordPress 3.5, the (now deprecated) version 1.6.2.1 (included with Attachments 3.x) will be used until you upgrade to WordPress 3.5+*
|
| 20 |
|
| 21 |
= Associate Media items with posts =
|
| 22 |
|
| 61 |
|
| 62 |
= Upgrading from version 1.x =
|
| 63 |
|
| 64 |
+
**You will need to update your theme files that use Attachments 3.0**. Version 1.x of Attachments has been **fully deprecated** but is still available *and included with Attachments 3.x*. If you would like to continue to use the (no longer supported) 1.x version you may add the following to your `wp-config.php`:
|
| 65 |
|
| 66 |
`define( 'ATTACHMENTS_LEGACY', true ); // force the legacy version of Attachments`
|
| 67 |
|
| 107 |
|
| 108 |
== Changelog ==
|
| 109 |
|
| 110 |
+
= 3.3.3 =
|
| 111 |
+
* Fixed a PHP Warning when activated using Multisite
|
| 112 |
+
* Slightly modified the migration process to better handle plugins like WPML (props sebastian.friedrich)
|
| 113 |
+
|
| 114 |
= 3.3.2 =
|
| 115 |
* You can now specify which view is default when browsing the Media modal (e.g. have 'Upload Files' be default instead of 'Media Library')
|
| 116 |
|
| 628 |
);
|
| 629 |
?>`
|
| 630 |
|
| 631 |
+
Once you've performed your search, you can loop through the returned Attachments as you normally would.
|
