Plugin Directory

Changeset 978254


Ignore:
Timestamp:
09/03/2014 11:26:01 PM (12 years ago)
Author:
3dolab
Message:

minor change

Location:
taxonomy-extra-tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • taxonomy-extra-tools/tags/0.1/admin/nav-menu.php

    r978243 r978254  
    146146            'object'
    147147        );
    148 
    149         $html = '<ul id="'. $this->metabox_list_id .'">';
    150         foreach ( $taxonomies as $tax ) {
    151             $html .= sprintf(
    152                 '<li><label><input type="checkbox" value ="%s" />&nbsp;%s</label></li>',
    153                 esc_attr( $tax->name ),
    154                 esc_attr( $tax->labels->name )
    155             );
    156         }
    157         $html .= '</ul>';
    158 
    159         // 'Add to Menu' button
    160         $html .= '<p class="button-controls"><span class="add-to-menu">';
    161         $html .= '<input type="submit"'. disabled( $nav_menu_selected_id, 0, false ) .' class="button-secondary
    162               submit-add-to-menu right" value="'. esc_attr( 'Add to Menu' ) .'"
    163               name="add-taxonomy-menu-item" id="submit-taxonomy-archives" />';
    164         $html .= '<span class="spinner"></span>';
    165         $html .= '</span></p>';
    166        
    167         print $html;
     148        $options = get_option('tet_options');
     149        if(!empty($options['archive_taxonomies'])) {
     150            $html = '<ul id="'. $this->metabox_list_id .'">';
     151            $active = $options['archive_taxonomies'];
     152            foreach ( $taxonomies as $name => $tax ) {
     153                if( in_array($name,$active) )
     154                    $html .= sprintf(
     155                        '<li><label><input type="checkbox" value ="%s" />&nbsp;%s</label></li>',
     156                        esc_attr( $tax->name ),
     157                        esc_attr( $tax->labels->name )
     158                    );
     159            }
     160            $html .= '</ul>';
     161
     162            // 'Add to Menu' button
     163            $html .= '<p class="button-controls"><span class="add-to-menu">';
     164            $html .= '<input type="submit"'. disabled( $nav_menu_selected_id, 0, false ) .' class="button-secondary
     165                  submit-add-to-menu right" value="'. esc_attr( 'Add to Menu' ) .'"
     166                  name="add-taxonomy-menu-item" id="submit-taxonomy-archives" />';
     167            $html .= '<span class="spinner"></span>';
     168            $html .= '</span></p>';
     169           
     170            print $html;
     171        }
    168172    }
    169173
  • taxonomy-extra-tools/trunk/admin/nav-menu.php

    r978243 r978254  
    146146            'object'
    147147        );
    148 
    149         $html = '<ul id="'. $this->metabox_list_id .'">';
    150         foreach ( $taxonomies as $tax ) {
    151             $html .= sprintf(
    152                 '<li><label><input type="checkbox" value ="%s" />&nbsp;%s</label></li>',
    153                 esc_attr( $tax->name ),
    154                 esc_attr( $tax->labels->name )
    155             );
    156         }
    157         $html .= '</ul>';
    158 
    159         // 'Add to Menu' button
    160         $html .= '<p class="button-controls"><span class="add-to-menu">';
    161         $html .= '<input type="submit"'. disabled( $nav_menu_selected_id, 0, false ) .' class="button-secondary
    162               submit-add-to-menu right" value="'. esc_attr( 'Add to Menu' ) .'"
    163               name="add-taxonomy-menu-item" id="submit-taxonomy-archives" />';
    164         $html .= '<span class="spinner"></span>';
    165         $html .= '</span></p>';
    166        
    167         print $html;
     148        $options = get_option('tet_options');
     149        if(!empty($options['archive_taxonomies'])) {
     150            $html = '<ul id="'. $this->metabox_list_id .'">';
     151            $active = $options['archive_taxonomies'];
     152            foreach ( $taxonomies as $name => $tax ) {
     153                if( in_array($name,$active) )
     154                    $html .= sprintf(
     155                        '<li><label><input type="checkbox" value ="%s" />&nbsp;%s</label></li>',
     156                        esc_attr( $tax->name ),
     157                        esc_attr( $tax->labels->name )
     158                    );
     159            }
     160            $html .= '</ul>';
     161
     162            // 'Add to Menu' button
     163            $html .= '<p class="button-controls"><span class="add-to-menu">';
     164            $html .= '<input type="submit"'. disabled( $nav_menu_selected_id, 0, false ) .' class="button-secondary
     165                  submit-add-to-menu right" value="'. esc_attr( 'Add to Menu' ) .'"
     166                  name="add-taxonomy-menu-item" id="submit-taxonomy-archives" />';
     167            $html .= '<span class="spinner"></span>';
     168            $html .= '</span></p>';
     169           
     170            print $html;
     171        }
    168172    }
    169173
Note: See TracChangeset for help on using the changeset viewer.