Changeset 415686
- Timestamp:
- 07/27/2011 12:33:29 AM (15 years ago)
- Location:
- taxonomy-widget/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
taxonomy-widget.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
taxonomy-widget/trunk/readme.txt
r415011 r415686 54 54 ==Changelog== 55 55 56 = 0.6.1 = 57 * Set value of the "taxonomies" property a bit later in the action sequence. 58 56 59 = 0.6 = 57 60 * Cleanup. -
taxonomy-widget/trunk/taxonomy-widget.php
r415011 r415686 4 4 Plugin URI: http://wordpress.org/extend/plugins/taxonomy-widget/ 5 5 Description: Display taxonomy terms in your sidebar. 6 Version: 0.6 6 Version: 0.6.1 7 7 Author: Michael Fields 8 8 Author URI: http://wordpress.mfields.org/ … … 64 64 ); 65 65 66 /* Get all public taxonomies. */67 $this->taxonomies = get_taxonomies( array( 'public' => true ), 'objects' );68 if ( empty( $this->taxonomies ) ) {69 return;70 }71 72 $taxonomies = array_keys( $this->taxonomies );73 if ( ! in_array( 'category', $taxonomies ) ) {74 $this->default_args['taxonomy'] = $taxonomies[0];75 }76 77 66 /* Custom CSS is for logged-in users only. */ 78 67 if ( current_user_can( 'edit_theme_options' ) ) { … … 82 71 } 83 72 84 /* Javascript listeners for dropdowns. */73 add_action( 'wp_loaded', array( &$this, 'set_taxonomies' ) ); 85 74 add_action( 'wp_footer', array( &$this, 'listeners_print' ) ); 75 } 76 77 /** 78 * Set the "taxonomies" property. 79 * 80 * Value should contain all public taxonomies registered with WordPress. 81 * This function should fire sometime after the 'init' hook. 82 * 83 * @since 0.6.1 84 */ 85 public function set_taxonomies() { 86 $this->taxonomies = get_taxonomies( array( 'public' => 1 ), 'objects' ); 87 88 $names = array_keys( $this->taxonomies ); 89 if ( ! in_array( 'category', $names ) ) { 90 $this->default_args['taxonomy'] = $names[0]; 91 } 86 92 } 87 93
Note: See TracChangeset
for help on using the changeset viewer.