Make WordPress Core

Ticket #12468: custom-header.diff

File custom-header.diff, 1.6 KB (added by colinloretz, 15 years ago)

Fixed the css and moved the option to the end of the table

  • /

    old new  
    141141
    142142                if ( isset($_POST['resetheader']) ) {
    143143                        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();
    145148                }
    146149
    147150                if ( isset($_POST['default-header']) ) {
     
    182185                echo '<table id="available-headers" cellspacing="0" cellpadding="0">';
    183186
    184187                $headers = array_keys($this->default_headers);
     188                $placement = (count($headers)) % 3;     
    185189                $table = array();
    186190                $rows = ceil(count($headers) / 3);
    187191                for ( $row = 1; $row <= $rows; $row++ ) {
     
    209213                                echo '<img src="' . $header_thumbnail . '" alt="' . esc_attr($header_desc) .'" /></label>';
    210214                                echo  '</td>';
    211215                        }
    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>';
    213221                }
     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>';
    214227                echo '</table>';
    215228        }
    216229