WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
370 | function __construct() { |
371 | $widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML')); |
372 | $control_ops = array('width' => 400, 'height' => 350); |
373 | parent::__construct('text', __('Text'), $widget_ops, $control_ops); |
374 | } |
375 |
|
376 | function widget( $args, $instance ) { |
377 | extract($args); |
378 | $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); |
379 | $text = apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance ); |
380 | echo $before_widget; |
381 | if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?> |
382 | <div class="textwidget"><?php echo !empty( $instance['filter'] ) ? wpautop( $text ) : $text; ?></div> |
383 | <?php |
384 | echo $after_widget; |
385 | } |
386 |
|
387 | function update( $new_instance, $old_instance ) { |
388 | $instance = $old_instance; |