WordPress.org

Plugin Directory

Changeset 507533


Ignore:
Timestamp:
02/20/12 08:17:40 (2 years ago)
Author:
jeffsebring
Message:

bug fixes, Render Framework Support

Location:
google-web-fonts-for-wordpress/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • google-web-fonts-for-wordpress/trunk/README.md

    r480590 r507533  
    44Requires at least: 3.2.1 
    55Tested up to: 3.3 
    6 Stable tag: 2.0.2 
     6Stable tag: 2.3 
    77 
    88== Description == 
     
    1212 
    1313* [Google Web Fonts for WordPress Plugin Home](http://jeffsebring.com/wordpress/plugins/google-web-fonts) 
    14 * [Typographic Web Design](http://jeffsebring.com/quotes/typographic-web-design/) 
    15 * [Jeff's WordPress Blog](http://jeffsebring.com) 
    16 * [Follow Jeff on Twitter](http://twitter.com/jeffsebring) 
    1714 
    1815== Installation == 
     
    4946* Save options in theme_mods 
    5047 
    51 = 2.0.1 =  
    52 * Set font api transient timeout to 24 hours. 
    5348 
    54 = 2.0.2 =  
    55 * Update saved font conditional. 
     49= 2.3 = 
     50* Bug Fixes 
     51* Added initial Render Framework support 
  • google-web-fonts-for-wordpress/trunk/includes/render_gwf_admin_enqueue.php

    r478527 r507533  
    1010    # Get global options var 
    1111    global $gwf; 
     12   $gwf_import = ''; 
    1213     
    1314    # Loop through saved fonts and add to string var 
    14     $num = 0; 
    15     while ( $num < 4 )  { 
    16         $num++; 
    17         $gwf_import .= $gwf[ $num ][ 'saved' ] . '|'; 
     15   for ( $i = 1; $i <= 3; $i++ )    { 
     16        $gwf_import .= $gwf[ $i ][ 'saved' ] . '|'; 
    1817    } 
    1918    $gwf_import = rtrim( $gwf_import, '|' ); 
  • google-web-fonts-for-wordpress/trunk/includes/render_gwf_enqueue.php

    r480587 r507533  
    77add_action( 'init', 'render_gwf_enqueue' ); 
    88function render_gwf_enqueue()   { 
    9      
    10     # Get options 
    11     include( 'render_gwf_get_options.php' ); 
    129 
    13     # Loop through options and add only active fonts to string var. 
    14     $num = 0; 
    15     while ( $num < 4 )  { 
    16         $num++; 
    17         if ( $gwf[ $num ][ 'active' ] == 'checked' )    : 
    18             $gwf_import .= $gwf[ $num ][ 'saved' ] . '|'; 
    19         endif; 
    20     } 
    21     $gwf_import = rtrim( $gwf_import, '|' ); 
    22     if ( ! empty( $gwf_import ) )   : 
    23      
    24         wp_register_style( 'google-web-fonts-front', 'http://fonts.googleapis.com/css?family=' . $gwf_import ); 
    25         wp_enqueue_style( 'google-web-fonts-front' ); 
    26      
    27     endif; 
     10   $gwf_import = ''; 
     11   # Get options 
     12   include( 'render_gwf_get_options.php' ); 
     13 
     14   # Loop through options and add only active fonts to string var. 
     15 
     16   for ( $i = 1; $i <= 3; $i++ )    { 
     17 
     18      if ( $gwf[ $i ][ 'active' ] == 'checked' )    : 
     19         $gwf_import .= $gwf[ $i ][ 'saved' ] . '|'; 
     20      endif; 
     21 
     22   } 
     23 
     24   $gwf_import = rtrim( $gwf_import, '|' ); 
     25   if ( ! empty( $gwf_import ) )    : 
     26 
     27      wp_register_style( 'google-web-fonts-front', 'http://fonts.googleapis.com/css?family=' . $gwf_import ); 
     28      wp_enqueue_style( 'google-web-fonts-front' ); 
     29 
     30   endif; 
    2831} 
    2932 
  • google-web-fonts-for-wordpress/trunk/includes/render_gwf_get_options.php

    r478527 r507533  
    44 
    55$default_fonts = array( 1 => 'Six Caps', 2 => 'Oswald', 3 => 'Prociono' ); 
    6 $num = 0;    
    76 
    8 while ( $num < 3 )  { 
    9     $num++; 
    10     $gwf[ $num ] = array(  
    11         'id' => 'gwf_font_' . $num, 
    12         'default' => $default_fonts[ $num ], 
    13         'saved' => get_theme_mod( 'gwf_font_' . $num ), 
    14         'active' => get_theme_mod( 'gwf_font_' . $num . '_activated' ) 
     7 
     8for ( $i = 1; $i <= 3; $i++ )   { 
     9    $gwf[ $i ] = array(  
     10        'id' => 'gwf_font_' . $i, 
     11        'default' => $default_fonts[ $i ], 
     12        'saved' => get_theme_mod( 'gwf_font_' . $i ), 
     13        'active' => get_theme_mod( 'gwf_font_' . $i . '_activated' ) 
    1514    ); 
    1615     
    17     $gwf_saved[ 'gwf_font_' . $num ] = get_theme_mod( 'gwf_font_' . $num ); 
    18     $gwf_saved[ 'gwf_font_' . $num . '_activated' ] = get_theme_mod( 'gwf_font_' . $num . '_activated' ); 
     16    $gwf_saved[ 'gwf_font_' . $i ] = get_theme_mod( 'gwf_font_' . $i ); 
     17    $gwf_saved[ 'gwf_font_' . $i . '_activated' ] = get_theme_mod( 'gwf_font_' . $i . '_activated' ); 
    1918} 
  • google-web-fonts-for-wordpress/trunk/includes/render_gwf_menu.php

    r478527 r507533  
    1111    global $gwf; 
    1212    global $gwf_saved; 
     13    
     14   $render_fonts[ 1 ] = 'Logo'; 
     15   $render_fonts[ 2 ] = 'Headings'; 
     16   $render_fonts[ 3 ] = 'Text'; 
     17 
    1318    include_once( 'render_gwf_api.php' ); 
    1419    $font_list = get_google_fonts( 'alpha', 'AIzaSyCP1Zewk9Ba3XboLIjPWdzh6yXcxxxoNRE'); 
    15      
    16     $num = 0; 
    17     while ( $num < 3 )  { 
    18         $num++;  
    19         $gwf_import .= $gwf[ $num ][ 'saved' ] . '|'; 
    20         $gwf_save[] = $gwf[ $num ][ 'id' ]; 
    21         $gwf_save[] = 'gwf_font_' . $num . '_activated'; 
     20   $gwf_import = ''; 
     21 
     22 
     23   for ( $i = 1; $i <= 3; $i++ )    { 
     24        $gwf_import .= $gwf[ $i ][ 'saved' ] . '|'; 
     25        $gwf_save[] = $gwf[ $i ][ 'id' ]; 
     26        $gwf_save[] = 'gwf_font_' . $i . '_activated'; 
    2227    } 
    2328    $gwf_import = rtrim( $gwf_import, '|' ); 
    24      
     29    
     30 
    2531    if ( $_GET['page'] == 'render_gwf' ) : 
    26         if ( 'Save Changes' == $_REQUEST['submit'] )    : 
    27              
     32        if ( ! isset( $_REQUEST['submit'] ) || ( $_REQUEST['submit'] != 'Save Changes' ) )  : 
     33         $submitted = null; 
     34      else  : 
     35            $submitted = $_REQUEST['submit']; 
    2836            check_admin_referer( 'render_gwf_admin' ); 
    2937            add_action('render_updated', 'render_saved_message'); 
     
    106114<?php do_action( 'render_updated' ); ?>  
    107115    <form method="post"> 
    108         <legend><p>Import up to three of over 350 free fonts available from the <a target="_blank" href="http://www.google.com/webfonts">Google Web Font Directory</a>.</p><p>After saving your font selections, add the supplied properties to the desired elements in your theme's stylesheet.</p><p>If you would like help with your typography, <a href="http://jeffsebring.com/quotes/typographic-web-design/">request a quote</a> at my website.</p></legend> 
     116        <legend><p>Import up to three of over 350 free fonts available from the <a target="_blank" href="http://www.google.com/webfonts">Google Web Font Directory</a>.</p><p>After saving your font selections, add the supplied properties to the desired elements in your theme's stylesheet.</p><?php if ( get_theme_mod( 'framework' ) == 'render' ) : echo '<strong style="color: #093EA2;">OOOhhh, You\'re using the <a style="color: #f00;" href="http://renderwp.com">Render Theme Framework</a>. We\'ll add your fonts automagically.</strong>'; endif; ?></legend> 
    109117        <?php wp_nonce_field( 'render_gwf_admin' ); ?> 
    110118        <table class="widefat" width="840px"> 
     
    123131      <tbody> 
    124132      <?php 
    125         $num = 0; 
    126         while ( $num < 3 )  { 
    127             $num++;  
    128             if ( 'Save Changes' == $_REQUEST['submit'] )    : 
     133         
     134        for ( $num = 1; $num <= 3; $num++ ) { 
     135 
     136            if ( 'Save Changes' == $submitted ) : 
    129137             
    130138                $display_active = $_REQUEST[ 'gwf_font_' . $num . '_activated' ]; 
     
    138146            ?> 
    139147            <tr> 
    140             <td> 
     148            <td><?php if ( get_theme_mod( 'framework' ) == 'render' ) : echo '<strong style="display: block; margin-bottom: .5em;">' . $render_fonts[ $num ] . " Font</strong>"; endif; ?> 
    141149                <select name="<?php echo $gwf[ $num ][ 'id' ]; ?>" id="<?php echo $gwf[ $num ][ 'id' ]; ?>"> 
    142150                    <?php foreach ( $font_list as $font ) { ?> 
     
    153161      </tbody> 
    154162</table> 
    155     <?php echo get_submit_button(); ?> 
     163    <?php submit_button(); ?> 
    156164    </form> 
    157165    </div> 
  • google-web-fonts-for-wordpress/trunk/readme.txt

    r480590 r507533  
    44Requires at least: 3.2.1 
    55Tested up to: 3.3 
    6 Stable tag: 2.0.2 
     6Stable tag: 2.0.1 
    77 
    88== Description == 
     
    1111= More Info = 
    1212 
    13 * [Google Web Fonts for WordPress Plugin Home](http://jeffsebring.com/wordpress/plugins/google-web-fonts) 
    14 * [Typographic Web Design](http://jeffsebring.com/quotes/typographic-web-design/) 
    15 * [Jeff's WordPress Blog](http://jeffsebring.com) 
    16 * [Follow Jeff on Twitter](http://twitter.com/jeffsebring) 
     13[Google Web Fonts for WordPress Plugin Home](http://jeffsebring.com/wordpress/plugins/google-web-fonts) 
    1714 
    1815== Installation == 
     
    5047 
    5148= 2.0.1 =  
    52 * Set font api transient timeout to 24 hours. 
     49* Set font api transiet timeout to 24 hours. 
    5350 
    54 = 2.0.2 =  
    55 * Update saved font conditional. 
     51= 2.0.2 = 
     52* Bug Fixes 
     53* Added initial Render Framework support 
     54 
  • google-web-fonts-for-wordpress/trunk/render_gwf.php

    r480392 r507533  
    44Plugin URI: http://jeffsebring.com/wordpress/plugins/google-web-fonts/ 
    55Description: Choose from any font in the Google Web Font Library for use in your theme's CSS. 
    6 Version: 2.0.1 
     6Version: 2.0.2 
    77Author: Jeff Sebring 
    88Author URI: http://jeffsebring.com 
     
    1010*/ 
    1111 
    12 if ( ! is_admin() ) : 
    13      
    14     # Enqueue active fonts 
    15     include_once( 'includes/render_gwf_enqueue.php' ); 
     12if ( ! is_admin() )  : 
     13 
     14   # Enqueue active fonts 
     15   include_once( 'includes/render_gwf_enqueue.php' ); 
    1616 
    1717elseif ( is_admin() )   : 
    1818 
    19     # Get options 
    20     include( 'includes/render_gwf_get_options.php' ); 
     19   # Get options 
     20   include( 'includes/render_gwf_get_options.php' ); 
    2121 
    22     # Install / Uninstall actions 
    23     include_once( 'includes/render_gwf_install.php' ); 
    24     register_activation_hook( __FILE__, 'render_gwf_activate' ); 
    25     register_deactivation_hook( __FILE__, 'render_gwf_activate' ); 
     22   # Install / Uninstall actions 
     23   include_once( 'includes/render_gwf_install.php' ); 
     24   register_activation_hook( __FILE__, 'render_gwf_activate' ); 
     25   register_deactivation_hook( __FILE__, 'render_gwf_activate' ); 
    2626 
    27     # Enqueue fonts for preview on options page 
    28     include_once( 'includes/render_gwf_admin_enqueue.php' ); 
    29      
    30     # Create options page in theme menu 
    31     include_once( 'includes/render_gwf_menu.php' ); 
     27   # Enqueue fonts for preview on options page 
     28   include_once( 'includes/render_gwf_admin_enqueue.php' ); 
     29 
     30   # Create options page in theme menu 
     31   include_once( 'includes/render_gwf_menu.php' ); 
    3232 
    3333endif; 
Note: See TracChangeset for help on using the changeset viewer.