if ( 'all' == $show && $is_multi ) {
// it's a multi-widget. We only need to show it in the list once.
$already_shown[] = $widget['callback'];
- $num = (int) array_pop( explode( '-', $widget['id'] ) );
+ $num = (int) array_pop( $ids = explode( '-', $widget['id'] ) );
$id_base = $wp_registered_widget_controls[$widget['id']]['id_base'];
// so that we always add a new one when clicking "add"
while ( isset($wp_registered_widgets["$id_base-$num"]) )
}
$add_query['add'] = $widget['id'];
$action = 'add';
- $add_url = wp_nonce_url( add_query_arg( $add_query ), "add-widget_$widget[id]" );
+ $add_url = clean_url( wp_nonce_url( add_query_arg( $add_query ), "add-widget_$widget[id]" ) );
} else {
$action = 'edit';
$edit_url = clean_url( add_query_arg( array(
<li id="widget-list-item-<?php echo attribute_escape( $widget['id'] ); ?>" class="widget-list-item">
<h4 class="widget-title widget-draggable">
- <?php echo $widget_title; ?>
+ <span><?php echo $widget_title; ?></span>
<?php if ( 'add' == $action ) : ?>
<?php endif; ?>
+ <br class="clear" />
+
</h4>
if ( empty($sidebar_args['_display']) || 'template' != $sidebar_args['_display'] )
echo $sidebar_args['before_widget'];
?>
- <h4 class="widget-title"><?php echo $widget_title ?>
+ <div class="widget-top">
+ <h4 class="widget-title"><span><?php echo $widget_title ?></span>
<?php if ( $edit ) : ?>
- <a class="widget-action widget-control-edit" href="<?php echo remove_query_arg( array( 'edit', 'key' ) ); ?>"><?php _e('Cancel'); ?></a>
+ <a class="widget-action widget-control-edit" href="<?php echo clean_url( remove_query_arg( array( 'edit', 'key' ) ) ); ?>"><?php _e('Cancel'); ?></a>
<?php else : ?>
<?php endif; ?>
- </h4>
+ <br class="clear" />
+
+ </h4></div>
<div class="widget-control"<?php if ( $edit ) echo ' style="display: block;"'; ?>>
return trim( wp_specialchars( strip_tags( $string ) ) );
}
-function widget_css() {
- wp_admin_css( 'css/widgets' );
-}
-
-add_action( 'admin_head', 'widget_css' );
-
?>