From 1fde7c8155db425ea2aa77d47b102cd3eb9ede7e Mon Sep 17 00:00:00 2001 From: Nathaniel Taintor Date: Thu, 7 Sep 2017 14:21:19 -0700 Subject: [PATCH 1/2] Fix call to removed `getFromCache` function in Shortcake d'oh. I had forgotten that this bug hadn't been fixed here yet. Sorry to everyone who had to patch it locally. --- assets/js/image-shortcake-admin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/js/image-shortcake-admin.js b/assets/js/image-shortcake-admin.js index c5e6cf8..bfab7af 100644 --- a/assets/js/image-shortcake-admin.js +++ b/assets/js/image-shortcake-admin.js @@ -54,7 +54,7 @@ var ImageShortcake = { return; } - var attachment = sui.views.editAttributeFieldAttachment.getFromCache( changed.value ); + var attachment = wp.media.attachment( changed.value ).attributes; if ( attachment ) { @@ -97,7 +97,7 @@ var ImageShortcake = { */ if ( typeof wp.shortcake !== 'undefined' && typeof wp.shortcake.hooks !== 'undefined' ) { - wp.shortcake.hooks.addAction( 'img.attachment', ImageShortcake.listeners.attachment ); + //wp.shortcake.hooks.addAction( 'img.attachment', ImageShortcake.listeners.attachment ); wp.shortcake.hooks.addAction( 'img.linkto', ImageShortcake.listeners.linkto ); } From 759fffbaf80e1060591a17e60b918765d81b7ecc Mon Sep 17 00:00:00 2001 From: Nathaniel Taintor Date: Fri, 8 Sep 2017 10:36:57 -0700 Subject: [PATCH 2/2] Uncomment accidentally commented-out code --- assets/js/image-shortcake-admin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/image-shortcake-admin.js b/assets/js/image-shortcake-admin.js index bfab7af..74e9872 100644 --- a/assets/js/image-shortcake-admin.js +++ b/assets/js/image-shortcake-admin.js @@ -97,7 +97,7 @@ var ImageShortcake = { */ if ( typeof wp.shortcake !== 'undefined' && typeof wp.shortcake.hooks !== 'undefined' ) { - //wp.shortcake.hooks.addAction( 'img.attachment', ImageShortcake.listeners.attachment ); + wp.shortcake.hooks.addAction( 'img.attachment', ImageShortcake.listeners.attachment ); wp.shortcake.hooks.addAction( 'img.linkto', ImageShortcake.listeners.linkto ); }