Ticket #9429: qcop-r00-admin-widget.patch
| File qcop-r00-admin-widget.patch, 4.1 KB (added by hakre, 4 years ago) |
|---|
-
wp-admin/widgets.php
80 80 if ( is_callable( $control['callback'] ) ) { 81 81 call_user_func_array( $control['callback'], $control['params'] ); 82 82 $control_output = ob_get_contents(); 83 if ( false !== strpos( $control_output, ' %i%' ) ) // if it's a multi-widget, only call control function once.83 if ( false !== strpos( $control_output, '.i.' ) ) // if it's a multi-widget, only call control function once. 84 84 $already_done[] = $control['callback']; 85 85 } 86 86 -
wp-admin/includes/widgets.php
71 71 72 72 $widget_id = $widget['id']; // save this for later in case we mess with $widget['id'] 73 73 74 $is_multi = false !== strpos( $widget_control_template, ' %i%' );74 $is_multi = false !== strpos( $widget_control_template, '.i.' ); 75 75 if ( !$sidebar || $is_multi ) { 76 76 $add_query = array( 77 77 'sidebar' => $sidebar, … … 243 243 244 244 // We aren't showing a widget control, we're outputing a template for a mult-widget control 245 245 if ( 'all' == $sidebar_args['_show'] && 'template' == $sidebar_args['_display'] && isset($control['params'][0]['number']) ) { 246 // number == -1 implies a template where id numbers are replaced by a generic ' %i%'246 // number == -1 implies a template where id numbers are replaced by a generic '.i.' 247 247 $control['params'][0]['number'] = -1; 248 248 // if given, id_base means widget id's should be constructed like {$id_base}-{$id_number} 249 249 if ( isset($control['id_base']) ) 250 $id_format = $control['id_base'] . '- %i%';250 $id_format = $control['id_base'] . '-.i.'; 251 251 } 252 252 253 253 $widget_title = ''; -
wp-admin/js/widgets.dev.js
75 75 var oldLi = $(this).parents('li:first').find('ul.widget-control-info li'); 76 76 var newLi = oldLi.clone(); 77 77 78 if ( newLi.html().match( /%i%/ ) ) { 79 // supplid form is a template, replace %i% by unique id 78 if ( newLi.html().match( /\.i\./ ) ) { 79 // supplid form is a template, replace .i. by unique id 80 // was %i%, but %i% is invalid while being used in id values 80 81 var i = $('#generated-time').val() + increment.toString(); 81 82 increment++; 82 newLi.html( newLi.html().replace( / %i%/g, i ) );83 newLi.html( newLi.html().replace( /\.i\./g, i ) ); 83 84 } else { 84 85 $(this).text( widgetsL10n.edit ).unbind().click( editClick ); 85 86 // save form content in textarea so we don't have any conflicting HTML ids -
wp-includes/default-widgets.php
438 438 <p> 439 439 <label for="<?php echo $this->get_field_id('title'); ?>"> 440 440 <?php _e( 'Title:' ); ?> 441 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?> >" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" />441 <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo $title; ?>" /> 442 442 </label> 443 443 </p> 444 444 … … 862 862 $url = ''; 863 863 $items = 10; 864 864 $error = false; 865 $number = ' %i%';865 $number = '.i.'; 866 866 $show_summary = 0; 867 867 $show_author = 0; 868 868 $show_date = 0; -
wp-includes/widgets.php
237 237 238 238 if ( -1 == $widget_args['number'] ) { 239 239 // We echo out a form where 'number' can be set later via JS 240 $this->_set(' %i%');240 $this->_set('.i.'); 241 241 $instance = array(); 242 242 } else { 243 243 $this->_set($widget_args['number']);