WordPress.org

Plugin Directory

Changeset 614625


Ignore:
Timestamp:
10/19/12 17:22:34 (18 months ago)
Author:
scribu
Message:

replace radio buttons with dropdowns

File:
1 edited

Legend:

Unmodified
Added
Removed
  • network-privacy/trunk/ra-network-privacy.php

    r614624 r614625  
    139139    // hook into blog privacy selector(options-privacy.php) 
    140140    function add_privacy_options($options) { 
    141  
    142141        $privacy = get_option( 'blog_public' ); 
    143         for( $i = ( is_multisite() ? -1 : -2 ); $i > -5; $i-- ) { 
     142 
     143        $dropdown = ''; 
     144 
     145        for ( $i = ( is_multisite() ? -1 : -2 ); $i > -5; $i-- ) { 
     146            $dropdown .= sprintf( '<option value="%d"%s>%s</option>', $i, selected( $i, $privacy, false ), $this->meta[$i]['settings_label'] ); 
     147        } 
     148 
     149        $dropdown = '<select name="blog_public" id="blog_public">' . $dropdown . '</select>'; 
     150 
    144151?> 
    145             <br /> 
    146             <input id="privacy-<?php echo $i; ?>" type="radio" name="blog_public" value="<?php echo $i; ?>" <?php checked( $i, $privacy ); ?> /> 
    147             <label for="privacy-<?php echo $i; ?>"><?php printf( __( 'I would like my site to be visible only to %s.', 'network-privacy'), $this->meta[$i]['settings_label'] ); ?></label> 
     152        <label for="blog_public"><?php printf( __( 'I would like my site to be visible only to %s.', 'network-privacy' ), $dropdown ); ?></label> 
    148153<?php 
    149         } 
    150  
    151     } 
     154    } 
     155 
    152156    function privacy_login_message () { 
    153157 
Note: See TracChangeset for help on using the changeset viewer.