Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created May 7, 2012 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/2630202 to your computer and use it in GitHub Desktop.
Save billerickson/2630202 to your computer and use it in GitHub Desktop.
Don't show "Associate with..." link on post's media uploader
Index: taxonomy-images.php
===================================================================
--- taxonomy-images.php (revision 541085)
+++ taxonomy-images.php (working copy)
@@ -117,6 +117,11 @@
* @alter 0.7
*/
function taxonomy_image_plugin_modal_button( $fields, $post ) {
+
+
+ if( isset( $_GET['post_id'] ) && $_GET['post_id'] )
+ return $fields;
+
if ( isset( $fields['image-size'] ) && isset( $post->ID ) ) {
$image_id = (int) $post->ID;
@mfields
Copy link

mfields commented May 7, 2012

Hi Bill,
Thanks for looking into this issue! More than a few users have asked about this same thing and, unfortunately, I've not had free time to look into a fix. I'll do some testing and integrate this into the plugin this week. Thanks for the patch. You rock!

@billerickson
Copy link
Author

Just updated it to include isset()

@jazbek
Copy link

jazbek commented May 4, 2013

This no longer seems to work in the latest wordpress.

@jazbek
Copy link

jazbek commented May 4, 2013

Actually, never mind, it's just that it only works on media library buttons that are on the edit post page. The Associate... button still shows in other plugins and pages that use the media library thickbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment