WordPress.org

Plugin Directory

Changeset 607147


Ignore:
Timestamp:
10/02/12 19:24:52 (19 months ago)
Author:
husobj
Message:

Fix tags not working on new upload.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • attachment-taxonomy-support/trunk/admin/admin.php

    r544392 r607147  
    5858    function admin_enqueue_scripts() { 
    5959        global $AttachmentTaxSupp, $current_screen; 
    60         if ( ( $current_screen->id == 'media' && isset( $_GET['attachment_id'] ) ) || ( isset( $_GET['taxonomy'] ) && isset( $_GET['post_type'] ) && 'attachment' == $_GET['post_type'] ) ) { 
     60        echo  $current_screen->id; 
     61        if ( ( $current_screen->id == 'media' ) || ( isset( $_GET['taxonomy'] ) && isset( $_GET['post_type'] ) && 'attachment' == $_GET['post_type'] ) ) { 
    6162            wp_enqueue_script( 'media_taxonomies', plugins_url( dirname( $AttachmentTaxSupp->plugin_basename ) . '/admin/js/admin.js' ), array( 'jquery', 'suggest', 'post' ) ); 
    6263        } 
     
    154155     */ 
    155156    function attachment_fields_to_edit( $form_fields, $post ) { 
     157        global $AttachmentTaxSupp, $current_screen; 
    156158        foreach ( $form_fields as $key => $val ) { 
    157159            if ( isset( $val['hierarchical'] ) && taxonomy_exists( $val['name'] ) ) { 
     
    245247                    $html .= '<p><a href="' . admin_url( '/edit-tags.php?taxonomy=' . $tax_name . '&post_type=attachment' ) . '">' . __( 'Manage', 'attachmenttaxsupp' ) . ' ' . $taxonomy->labels->name . '</a></p>'; 
    246248                    $html .= wp_nonce_field( 'update_attachment', '_wpnonce_attachmenttaxsupp', true, false ); 
     249                     
     250                    if ( 'async-upload' == $current_screen->id ) { 
     251                        $html .= '<script type="text/javascript">tagBox.init();</script>'; 
     252                    } 
     253                     
    247254                    $form_fields[$key]['input'] = 'html'; 
    248255                    $form_fields[$key]['html'] = $html; 
Note: See TracChangeset for help on using the changeset viewer.