widget.php
37 lines
| 1 | <?php |
| 2 | echo $before_widget; |
| 3 | if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } |
| 4 | if ( !empty( $image ) ) { |
| 5 | if ( $link ) { |
| 6 | echo '<a class="'.$this->widget_options['classname'].'-image-link" href="'.$link.'" target="'.$linktarget.'">'; |
| 7 | } |
| 8 | if ( $imageurl ) { |
| 9 | echo "<img src=\"{$imageurl}\" style=\""; |
| 10 | if ( !empty( $width ) && is_numeric( $width ) ) { |
| 11 | echo "max-width: {$width}px;"; |
| 12 | } |
| 13 | if ( !empty( $height ) && is_numeric( $height ) ) { |
| 14 | echo "max-height: {$height}px;"; |
| 15 | } |
| 16 | echo "\""; |
| 17 | if ( !empty( $align ) && $align != 'none' ) { |
| 18 | echo " class=\"align{$align}\""; |
| 19 | } |
| 20 | if ( !empty( $alt ) ) { |
| 21 | echo " alt=\"{$alt}\""; |
| 22 | } else { |
| 23 | echo " alt=\"{$title}\""; |
| 24 | } |
| 25 | echo " />"; |
| 26 | } |
| 27 | |
| 28 | if ( $link ) { echo '</a>'; } |
| 29 | } |
| 30 | if ( !empty( $description ) ) { |
| 31 | $text = apply_filters( 'widget_text', $description ); |
| 32 | echo '<div class="'.$this->widget_options['classname'].'-description" >'; |
| 33 | echo wpautop( $text ); |
| 34 | echo "</div>"; |
| 35 | } |
| 36 | echo $after_widget; |
| 37 | ?> |