Ticket #1902: 1902.patch
File 1902.patch, 3.6 KB (added by , 8 years ago) |
---|
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wc-fonts/wc-fonts.php
12 12 add_action( 'init', array( $this, 'init' ) ); 13 13 add_action( 'admin_init', array( $this, 'admin_init' ) ); 14 14 add_action( 'admin_menu', array( $this, 'admin_menu' ) ); 15 15 16 16 add_action( 'wp_head', array( $this, 'wp_head_typekit' ), 102 ); // after safecss_style 17 17 add_action( 'wp_head', array( $this, 'wp_head_google_web_fonts' ) ); 18 18 add_action( 'wp_head', array( $this, 'wp_head_font_awesome' ) ); … … 25 25 function init() { 26 26 $this->options = (array) get_option( 'wc-fonts-options', array() ); 27 27 } 28 28 29 29 /** 30 30 * Provides the <head> output for Typekit settings. 31 31 */ … … 32 32 function wp_head_typekit() { 33 33 if ( ! isset( $this->options['typekit-id'] ) || empty( $this->options['typekit-id'] ) ) 34 34 return; 35 35 36 36 printf( '<script type="text/javascript" src="https://use.typekit.com/%s.js"></script>' . "\n", $this->options['typekit-id'] ); 37 37 printf( '<script type="text/javascript">try{Typekit.load();}catch(e){}</script>' ); 38 38 } … … 91 91 * Runs during admin_menu, adds a Fonts section to Appearance 92 92 */ 93 93 function admin_menu() { 94 $fonts = add_theme_page( 'Fonts', 'Fonts', 'edit_theme_options', 'wc-fonts-options', array( $this, 'render_admin_page' ) );94 $fonts = add_theme_page( __( 'Fonts', 'wordcamporg' ), __( 'Fonts', 'wordcamporg' ), 'edit_theme_options', 'wc-fonts-options', array( $this, 'render_admin_page' ) ); 95 95 } 96 96 97 97 /** 98 98 * Uses the Settings API to render the Appearance > Fonts page 99 99 */ … … 101 101 ?> 102 102 <div class="wrap"> 103 103 <?php screen_icon(); ?> 104 <h1> Fonts</h1>104 <h1><?php esc_html_e( 'Fonts', 'wordcamporg' ); ?></h1> 105 105 <?php settings_errors(); ?> 106 106 <form method="post" action="options.php" enctype="multipart/form-data"> 107 107 <?php … … 121 121 $value = isset( $this->options['typekit-id'] ) ? $this->options['typekit-id'] : ''; 122 122 ?> 123 123 <input type="text" name="wc-fonts-options[typekit-id]" value="<?php echo esc_attr( $value ); ?>" class="regular-text code" /> 124 <p class="description"> Enter your Typekit Kit ID. No links, no javascript, just the id, we'll handle the rest for you.</p>124 <p class="description"><?php esc_html_e( "Enter your Typekit Kit ID. No links, no javascript, just the id, we'll handle the rest for you.", 'wordcamporg' ); ?></p> 125 125 <?php 126 126 } 127 127 … … 132 132 $value = isset( $this->options['google-web-fonts'] ) ? $this->options['google-web-fonts'] : ''; 133 133 ?> 134 134 <textarea rows="5" name="wc-fonts-options[google-web-fonts]" class="large-text code"><?php echo esc_textarea( $value ); ?></textarea> 135 <p class="description"> Paste the Google Web Fonts @import URLs in this area, each one on a separate line.</p>135 <p class="description"><?php esc_html_e( 'Paste the Google Web Fonts @import URLs in this area, each one on a separate line.', 'wordcamporg' ); ?></p> 136 136 <?php 137 137 } 138 138 … … 144 144 ?> 145 145 146 146 <input type="text" name="wc-fonts-options[font-awesome-url]" value="<?php echo esc_url( $value ); ?>" class="large-text code" /> 147 <p class="description"> Enter the BootstrapCDN URL for the version you want.</p>147 <p class="description"><?php esc_html_e( 'Enter the BootstrapCDN URL for the version you want.', 'wordcamporg' ); ?></p> 148 148 149 149 <?php 150 150 } … … 225 225 } 226 226 227 227 // Go! 228 new WordCamp_Fonts_Plugin; 229 No newline at end of file 228 new WordCamp_Fonts_Plugin;