1024 | | $current_taxonomy = $this->_get_current_taxonomy($instance); |
1025 | | ?> |
1026 | | <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label> |
1027 | | <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php if (isset ( $instance['title'])) {echo esc_attr( $instance['title'] );} ?>" /></p> |
1028 | | <p><label for="<?php echo $this->get_field_id('taxonomy'); ?>"><?php _e('Taxonomy:') ?></label> |
1029 | | <select class="widefat" id="<?php echo $this->get_field_id('taxonomy'); ?>" name="<?php echo $this->get_field_name('taxonomy'); ?>"> |
1030 | | <?php foreach ( get_object_taxonomies('post') as $taxonomy ) : |
1031 | | $tax = get_taxonomy($taxonomy); |
1032 | | if ( !$tax->show_tagcloud || empty($tax->labels->name) ) |
1033 | | continue; |
1034 | | ?> |
1035 | | <option value="<?php echo esc_attr($taxonomy) ?>" <?php selected($taxonomy, $current_taxonomy) ?>><?php echo $tax->labels->name; ?></option> |
1036 | | <?php endforeach; ?> |
1037 | | </select></p><?php |
| 1028 | ?> |
| 1029 | |
| 1030 | <p> |
| 1031 | <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:') ?></label> |
| 1032 | <input type="text" class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php if (isset ( $instance['title'])) {echo esc_attr( $instance['title'] );} ?>" /> |
| 1033 | </p> |
| 1034 | |
| 1035 | <?php |
| 1036 | |
| 1037 | $current_taxonomy = $this->_get_current_taxonomy( $instance ); |
| 1038 | $taxonomies = get_taxonomies( array( 'show_tagcloud' => true ), 'object' ); |
| 1039 | |
| 1040 | switch ( count( $taxonomies ) ) : |
| 1041 | |
| 1042 | case 0 : ?> |
| 1043 | |
| 1044 | <p><?php _e( 'Sorry, but there are no taxonomies for which a tag cloud could be made and therefore, no tag cloud would be displayed!' ); ?></p> |
| 1045 | <input type="hidden" id="<?php echo $this->get_field_id( 'taxonomy' ); ?>" name="<?php echo $this->get_field_name( 'taxonomy' ); ?>" value="" /> |
| 1046 | |
| 1047 | <?php break; |
| 1048 | |
| 1049 | case 1 : |
| 1050 | |
| 1051 | $taxonomy = array_pop( array_keys( $taxonomies ) ); ?> |
| 1052 | |
| 1053 | <input type="hidden" id="<?php echo $this->get_field_id( 'taxonomy' ); ?>" name="<?php echo $this->get_field_name( 'taxonomy' ); ?>" value="<?php echo esc_attr( $taxonomy ); ?>" /> |
| 1054 | |
| 1055 | <?php break; |
| 1056 | |
| 1057 | default : ?> |
| 1058 | |
| 1059 | <p> |
| 1060 | <label for="<?php echo $this->get_field_id('taxonomy'); ?>"><?php _e('Taxonomy:') ?></label> |
| 1061 | <select class="widefat" id="<?php echo $this->get_field_id('taxonomy'); ?>" name="<?php echo $this->get_field_name('taxonomy'); ?>"> |
| 1062 | <?php foreach ( $taxonomies as $taxonomy => $tax ) : ?> |
| 1063 | <option value="<?php echo esc_attr($taxonomy) ?>" <?php selected($taxonomy, $current_taxonomy) ?>><?php echo $tax->labels->name; ?></option> |
| 1064 | <?php endforeach; ?> |
| 1065 | </select> |
| 1066 | </p> |
| 1067 | |
| 1068 | <?php endswitch; |
| 1069 | |