Changeset 599157
- Timestamp:
- 09/15/2012 03:05:03 AM (13 years ago)
- Location:
- get-user-info/trunk
- Files:
-
- 2 edited
-
getUserInfo.php (modified) (4 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
get-user-info/trunk/getUserInfo.php
r597324 r599157 36 36 extract( $args ); 37 37 $title = apply_filters( 'widget_title', $instance['title'] ); 38 $cssClass = apply_filters('widget_title', empty($instance['cssClass']) ? '' : $instance['cssClass'], $instance); 38 39 $user = apply_filters( 'widget_title', $instance['userName'] ); 40 if ( $cssClass ) { 41 if( strpos($before_widget, 'class') === false ) { 42 $before_widget = str_replace('>', 'class="'. $cssClass . '"', $before_widget); 43 } else { 44 $before_widget = str_replace('class="', 'class="'. $cssClass . ' ', $before_widget); 45 } 46 } 39 47 40 48 $user = get_userdatabylogin($user); … … 69 77 $instance['userName'] = strip_tags( $new_instance['userName'] ); 70 78 $instance['title'] = strip_tags($new_instance['title']); 79 $instance['cssClass'] = strip_tags($new_instance['cssClass']); 71 80 72 81 return $instance; … … 84 93 $userName = $instance[ 'userName' ]; 85 94 $title = $instance['title']; 95 $cssClass = strip_tags($instance['cssClass']); 86 96 } 87 97 else { … … 92 102 <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> 93 103 <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /> 104 </p> 105 <p> 106 <label for="<?php echo $this->get_field_id('cssClass'); ?>"><?php _e('CSS Class:'); ?></label> 107 <input class="widefat" id="<?php echo $this->get_field_id('cssClass'); ?>" name="<?php echo $this->get_field_name('cssClass'); ?>" type="text" value="<?php echo esc_attr($cssClass); ?>" /> 94 108 </p> 95 109 <p> -
get-user-info/trunk/readme.txt
r597328 r599157 19 19 2. Activate the plugin through the 'Plugins' menu in WordPress 20 20 3. Add a Get User Info widget to any sidebar and add a title if needed then add the user name of the user you want to display. You can also display the user info by using the following shortcode '[authorinfo user="User Name"]' (replace User Name with the user name that you want to display ex. [authorinfo user="Bill"]) 21 4. Add a css class that will allow you to style the widget if you want. 21 22 22 23 == Changelog == 24 25 = 1.0.3 = 26 * Added the css class functionality to the widget. 23 27 24 28 = 1.0.2 =
Note: See TracChangeset
for help on using the changeset viewer.