Add action "in_widget_form" allowing plugins to add extra fields, don't show "Save" button if a widget doesn't have settings form, fixes #9651

git-svn-id: https://develop.svn.wordpress.org/trunk@11155 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz
2009-05-02 00:21:16 +00:00
parent 47d56db997
commit d9e724974f
2 changed files with 11 additions and 5 deletions
+2 -2
View File
@@ -166,7 +166,7 @@ function wp_widget_control( $sidebar_args ) {
unset($wp_registered_widgets[$widget_id]['_callback']);
$widget_title = wp_specialchars( strip_tags( $sidebar_args['widget_name'] ) );
$has_form = 0;
$has_form = 'noform';
echo $sidebar_args['before_widget']; ?>
<div class="widget-top">
@@ -195,7 +195,7 @@ function wp_widget_control( $sidebar_args ) {
<div class="widget-control-actions">
<a class="button widget-control-remove alignleft" href="<?php echo $edit ? clean_url( add_query_arg( array( 'remove' => $id_format, 'key' => $key, '_wpnonce' => $nonce ) ) ) : '#remove'; ?>"><?php _e('Remove'); ?></a>
<?php if ( false !== $has_form ) { ?>
<?php if ( 'noform' !== $has_form ) { ?>
<input type="submit" name="savewidget" class="button-primary widget-control-save alignright" value="<?php _e('Save'); ?>" />
<?php } ?>
<br class="clear" />