Ticket #12133: patch.diff
File patch.diff, 1.1 KB (added by , 12 years ago) |
---|
-
wp-includes/widgets.php
107 107 * @return string Name attribute for $field_name 108 108 */ 109 109 function get_field_name($field_name) { 110 return 'widget-' . $this->id_base . '[' . $this->number . '][' . $field_name . ']'; 110 if (strpos($field_name, '[') === false) 111 return 'widget-' . $this->id_base . '[' . $this->number . '][' . ($field_name) . ']'; 112 else 113 return 'widget-' . $this->id_base . '[' . $this->number . '][' . substr($field_name, 0, strpos($field_name, '[')) . ']' . substr($field_name, strpos($field_name, '[')); 111 114 } 112 115 113 116 /** … … 119 122 * @return string ID attribute for $field_name 120 123 */ 121 124 function get_field_id($field_name) { 122 return 'widget-' . $this->id_base . '-' . $this->number . '-' . $field_name;125 return 'widget-' . $this->id_base . '-' . $this->number . '-' . str_replace(array('][', '[', ']', ' '), '-', trim($field_name, ' []')); 123 126 } 124 127 125 128 // Private Functions. Don't worry about these.