%PDF- %PDF-
| Direktori : /dom495844/wp-content/plugins/source-mce/ |
| Current File : /dom495844/wp-content/plugins/source-mce/source-mce.php |
<?php
/**
* Plugin Name: Source MCE
* Plugin URI: http://cambridgesourcesites.com
* Description: This plugin contains additions and modifications to the TinyMCE editor in WordPress.
* Version: 0.6
* Author: Michael Franklin
* Author URI:
*
* Changelog:
* 2015.06.22
* - Added additional class to Divi button custom style to maintain compatability with Divi 2.4
* 2015.01.23:
* - Compatible with WordPress 4.1
* - Added Divi button custom style
* 2014.05.14:
* - Compatible with WordPress 3.9.1
* - Removed sup and sub buttons in favor of Formats dropdown
* - Added Inline Disclosure custom format
* - Added Footer Disclosure custom format
*
*/
// Add Formats Dropdown Menu To MCE
if ( ! function_exists( 'wpex_style_select' ) ) {
function wpex_style_select( $buttons ) {
array_push( $buttons, 'styleselect' );
return $buttons;
}
}
add_filter( 'mce_buttons_2', 'wpex_style_select' );
// Add new styles to the TinyMCE "formats" menu dropdown
if ( ! function_exists( 'wpex_styles_dropdown' ) ) {
function wpex_styles_dropdown( $settings ) {
// Create array of new styles
$new_styles = array(
array(
'title' => __( 'Custom Styles', 'wpex' ),
'items' => array(
array(
'title' => __('Inline Disclosure','wpex'),
'inline' => 'span',
'styles' => array (
'font-size' => '10px',
),
),
array(
'title' => __('Footer Disclosure','wpex'),
'inline' => 'span',
'styles' => array (
'font-size' => '12px',
),
),
array(
'title' => __('Small Caps','wpex'),
'inline' => 'span',
'styles' => array (
'font-variant' => 'small-caps',
),
),
array(
'title' =>__('Divi Style Button','wpex'),
'selector' => 'a',
'classes' => array (
'et_pb_promo_button',
'et_pb_button',
),
),
),
),
);
// Merge old & new styles
$settings['style_formats_merge'] = true;
// Add new styles
$settings['style_formats'] = json_encode( $new_styles );
// Return New Settings
return $settings;
}
}
add_filter( 'tiny_mce_before_init', 'wpex_styles_dropdown' );
//Keep the Kitchen Sink on by default
add_filter( 'tiny_mce_before_init', 'myformatTinyMCE' );
function myformatTinyMCE( $in ) {
$in['wordpress_adv_hidden'] = FALSE;
return $in;
}
// DEPRECIATED FUNCTIONS
//
/*function my_mce_buttons_3($buttons) {
*
* Add in a core button that's disabled by default
$buttons[] = 'sup';
$buttons[] = 'sub';
return $buttons;
}
add_filter('mce_buttons_3', 'my_mce_buttons_3');*/
/*function custom_mce_styles( $init ) {
$init['theme_advanced_buttons2_add_before'] = 'styleselect';
$init['theme_advanced_styles'] = 'Footnote=footnote';
return $init;
}
add_filter( 'tiny_mce_before_init', 'custom_mce_styles' );*/