Changeset 1885230
- Timestamp:
- 06/01/2018 04:26:36 AM (8 years ago)
- Location:
- kv-tinymce-editor-fonts/trunk
- Files:
-
- 2 edited
-
kv_fonts.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kv-tinymce-editor-fonts/trunk/kv_fonts.php
r1640599 r1885230 7 7 Version: 1.1 8 8 Author URI: http://profiles.wordpress.org/kvvaradha 9 10 9 */ 11 10 12 11 define('KV_FONT_TINYMCE_URL', plugin_dir_url( __FILE__ )); 12 13 if(!function_exists('kv_tinymce_fonts_deactivate')) { 14 function kv_tinymce_fonts_deactivate(){ 15 if ( ! current_user_can( 'activate_plugins' ) ) 16 return; 17 $plugin = isset( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : ''; 18 check_admin_referer( "deactivate-plugin_{$plugin}" ); 19 update_option( 'ShowDefaultFonts', '1'); 20 add_filter("mce_buttons_3", "kv_add_font_family_size"); 21 } 22 23 register_deactivation_hook( __FILE__, 'kv_tinymce_fonts_deactivate' ); 24 } 13 25 14 26 if(!function_exists('kv_admin_menu')) { … … 178 190 179 191 function kv_custom_font_list($in){ 192 193 if(get_option('ShowDefaultFonts') == 1 ){ 194 $in['font_formats'] = "Arial=arial,helvetica,sans-serif;". 195 "Arial Black=arial black,avant garde;". 196 "Comic Sans MS=comic sans ms,sans-serif;". 197 "Courier New=courier new,courier;". 198 "Georgia=georgia,palatino;". 199 "Helvetica=helvetica;". 200 "Tahoma=tahoma,arial,helvetica,sans-serif;". 201 "Terminal=terminal,monaco;". 202 "Times New Roman=times new roman,times;". 203 "Trebuchet MS=trebuchet ms,geneva;". 204 "Verdana=verdana,geneva;"; 205 } else { 206 $in['font_formats'] = ''; 207 } 180 208 if ( get_option( 'KvcodesGoogleFonts' ) !== false ){ 181 209 $KvcodesGoogleFonts = get_option( 'KvcodesGoogleFonts' ); … … 184 212 $kvfont_formats .= $singleFont.'='.$singleFont.';'; 185 213 } 186 $in['font_formats'] = $kvfont_formats;214 $in['font_formats'] .= $kvfont_formats; 187 215 }else 188 $in['font_formats'] = 'Open Sans=Open Sans; Josefin=Josefin; Slab=Slab; Arvo=Arvo; Lato=Lato; Vollkorn=Vollkorn; Ubuntu=Ubuntu; Old Standard TT=Old Standard TT; Droid Sans=Droid Sans; Roboto=Roboto; Oswald=Oswald; Source Sans Pro=Source Sans Pro' ;216 $in['font_formats'] .= 'Open Sans=Open Sans; Josefin=Josefin; Slab=Slab; Arvo=Arvo; Lato=Lato; Vollkorn=Vollkorn; Ubuntu=Ubuntu; Old Standard TT=Old Standard TT; Droid Sans=Droid Sans; Roboto=Roboto; Oswald=Oswald; Source Sans Pro=Source Sans Pro' ; 189 217 190 218 $in['fontsize_formats'] = "9px 10px 12px 13px 14px 16px 18px 21px 24px 28px 32px 36px"; 191 219 return $in; 192 220 } 221 222 193 223 add_filter('tiny_mce_before_init', 'kv_custom_font_list' ); 194 224 … … 200 230 $fontsList = get_option('KvcodesGoogleFonts'); 201 231 if ( get_option( 'KvcodesGoogleFonts' ) !== false ) { 202 update_option( 'KvcodesGoogleFonts', $_POST['KvcodesGoogleFonts'] ); 232 update_option( 'KvcodesGoogleFonts', $_POST['KvcodesGoogleFonts'] ); 203 233 } else{ 204 add_option( 'KvcodesGoogleFonts', $_POST['KvcodesGoogleFonts'] ); 234 add_option( 'KvcodesGoogleFonts', $_POST['KvcodesGoogleFonts'] ); 235 } 236 237 $fontsList = get_option('ShowDefaultFonts'); 238 if ( get_option( 'ShowDefaultFonts' ) !== false ) { 239 update_option( 'ShowDefaultFonts', (isset($_POST['ShowDefaultFonts']) ? '1' : '0') ); 240 } else { 241 add_option( 'ShowDefaultFonts', (isset($_POST['ShowDefaultFonts']) ? '1' : '0') ); 205 242 } 206 243 } … … 244 281 </td> 245 282 </tr> 283 <tr> 284 <td> Show Default Fonts </td> 285 <td> <input type="checkbox" name="ShowDefaultFonts" value="1" <?php echo ((get_option('ShowDefaultFonts') !== false && get_option('ShowDefaultFonts') == 1 )? 'checked' : '') ; ?> > </td> 286 </tr> 246 287 </tbody> 247 288 </table> 289 248 290 <p class="submit" style="margin-left: 5%;"><input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes"></p> 249 291 </form> -
kv-tinymce-editor-fonts/trunk/readme.txt
r1641249 r1885230 4 4 Tags: tinymce editor, google fonts tinymce editor, kvcodes, Google Fonts, WordPress Google Webfonts, webfonts, WordPress Google Fonts Plugin 5 5 Requires at least: 3.1 6 Tested up to: 4. 76 Tested up to: 4.9.6 7 7 License: GPL 8 8 … … 20 20 * Simple Set-up, Less space consuming 21 21 * Google Web Fonts added 22 * You can have an option to enable and disable default fonts list 22 23 23 24
Note: See TracChangeset
for help on using the changeset viewer.