Ticket #12468: custom-header.diff
File custom-header.diff, 1.6 KB (added by , 15 years ago) |
---|
-
/
old new 141 141 142 142 if ( isset($_POST['resetheader']) ) { 143 143 check_admin_referer('custom-header'); 144 remove_theme_mods(); 144 if($_POST['default-header'] == 'none') 145 set_theme_mod('header_image', ''); 146 else 147 remove_theme_mods(); 145 148 } 146 149 147 150 if ( isset($_POST['default-header']) ) { … … 182 185 echo '<table id="available-headers" cellspacing="0" cellpadding="0">'; 183 186 184 187 $headers = array_keys($this->default_headers); 188 $placement = (count($headers)) % 3; 185 189 $table = array(); 186 190 $rows = ceil(count($headers) / 3); 187 191 for ( $row = 1; $row <= $rows; $row++ ) { … … 209 213 echo '<img src="' . $header_thumbnail . '" alt="' . esc_attr($header_desc) .'" /></label>'; 210 214 echo '</td>'; 211 215 } 212 echo '</tr>'; 216 217 if($placement == 0 && $row == $rows) //add a new line if the table is full. 218 echo '</tr><tr>'; 219 elseif($placement == 0 && $row != $rows) 220 echo '</tr>'; 213 221 } 222 echo '<td class="' . join(' ', $class) . '">'; 223 echo '<label><input name="default-header" type="radio" value = "none" ' . checked('', get_header_image(), false) . ' />'; 224 echo '<div style = "border: 1px solid #AAA; padding: 10px; display: inline-block; width: 208px; vertical-align: middle; text-align: center; height: 16px;">No header image</div></label>'; 225 echo '</td>'; 226 echo '</tr>'; 214 227 echo '</table>'; 215 228 } 216 229