WordPress.org

Plugin Directory

Changeset 632474


Ignore:
Timestamp:
11/30/12 22:53:34 (17 months ago)
Author:
miqrogroove
Message:

Rough work on a login page contrast solution.

Location:
fix-admin-contrast/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fix-admin-contrast/trunk/admin-contrast.php

    r632456 r632474  
    4545 */ 
    4646function miqro_contrast_hook() { 
    47     $callback = miqro_contrast_get_callback(); 
    48     if (!empty($callback)) add_action('admin_head', $callback, 10, 0); 
    49 } 
    50  
    51 /** 
    52  * Login page logic. 
    53  * 
    54  * @since 1.5 
    55  */ 
    56 function miqro_contrast_login() { 
    57     $oldest = 33; 
    58     $callback = miqro_contrast_get_callback($oldest); 
    59     if (!empty($callback)) call_user_func($callback); 
    60 } 
    61  
    62 /** 
    63  * Selects one of the following output functions based on WP version. 
    64  * 
    65  * @since 1.5 
    66  * 
    67  * @param int $oldest Optional.  The oldest WP version supported. 
    68  * @return callback 
    69  */ 
    70 function miqro_contrast_get_callback($oldest = 27) { 
     47    $oldest = 27; 
    7148    $newest = 35; 
    7249 
     
    7653    if ($wpversion < $oldest) return; 
    7754    if ($wpversion > 29 and $wpversion < 34) $wpversion = 29; 
    78  
    79     return "miqro_fix_admin_contrast_$wpversion"; 
     55    $callback = "miqro_fix_admin_contrast_$wpversion"; 
     56 
     57    add_action('admin_head', $callback, 10, 0); 
     58} 
     59 
     60/** 
     61 * Login page logic. 
     62 * 
     63 * @since 1.5 
     64 */ 
     65function miqro_contrast_login() { 
     66    $oldest = 31; 
     67    $newest = 31; 
     68 
     69    $wpversion = get_bloginfo('version'); 
     70    if (strlen($wpversion) < 3) return; 
     71    $wpversion = min($newest, intval($wpversion[0].$wpversion[2])); 
     72    if ($wpversion < $oldest) return; 
     73    $callback = "miqro_fix_login_contrast_$wpversion"; 
     74 
     75    call_user_func($callback); 
    8076} 
    8177 
     
    241237<?php 
    242238} 
    243 ?> 
     239 
     240/** 
     241 * Tested and working on 3.1 through 3.5-RC2. 
     242 * Corrects login.css or wp-admin.css. 
     243 */ 
     244function miqro_fix_login_contrast_31() { 
     245?> 
     246<style type="text/css"> 
     247.login form .input, 
     248.login input[type="text"] { 
     249    border-color: #BBB; 
     250} 
     251</style> 
     252<?php 
     253} 
     254?> 
  • fix-admin-contrast/trunk/readme.txt

    r632456 r632474  
    3434= 1.5 = 
    3535* Updated ... 
    36 * Fixed contrast on the login page for WordPress 3.3+ 
     36* Fixed contrast on the login page for WordPress 3.1+ 
    3737 
    3838= 1.4.1 = 
Note: See TracChangeset for help on using the changeset viewer.