jchristopher / attachments

[WordPress Plugin] Attachments allows you to simply append any number of items from your WordPress Media Library to Posts, Pages, and Custom Post Types
wordpress.org/extend/plugins/attachments/
GNU General Public License v2.0
239 stars 78 forks source link

Bug with using 'attachment' instead of $this->meta_key #48

Closed leoloso closed 11 years ago

leoloso commented 11 years ago

Hello, thanks for the plugin, it is awesome! I found a bug: right now it always searches under meta_key 'attachments', I changed this value to something else but it is not working.

I found it is because, in class.attachments.php, function search, where it says:

array(
    'key'       => 'attachments',
    'value'     => $query,
    'compare'   => 'LIKE'
)

it should be:

array(
    'key'       => $this->meta_key,
    'value'     => $query,
    'compare'   => 'LIKE'
)

Cheers Leo

jchristopher commented 11 years ago

Great catch! I'll get a fix in the next version.

jchristopher commented 11 years ago

This Issues has been fixed in https://github.com/jchristopher/attachments/commit/b49662a6ebc277ef9a9885edcb50fb472238ce3d; it will be available in the next release on .org, thank you!