'; _e( 'WP Super Edit Plugin Required! Activate WP Super Edit before using. Plugin Deactivated.', 'wp-super-edit' ); echo '
'; } /** * WP Super Class function to register items in WP Super Edit * Use $wp_super_edit primary object instance to add settings to database using register_tinymce_plugin() and register_tinymce_button() as many times as needed. * @global object $wp_super_edit */ function wp_super_css_classes_activate() { global $wp_super_edit; if ( empty( $wp_super_edit ) || !is_object( $wp_super_edit ) ) return false; // WP Super Edit options for this plugin $wp_super_edit->register_tinymce_plugin( array( 'name' => 'supercssclasses', 'nicename' => __( 'Custom CSS Classes', 'wp-super-edit' ), 'description' => __( 'Adds Custom styles button and CLASSES from an editor.css file in your Currently active THEME directory. Provides the Custom CSS Classes Button.', 'wp-super-edit' ), 'provider' => 'wp-se-cssclasses', 'status' => 'no', 'callbacks' => '' )); // Tiny MCE Buttons provided by this plugin $wp_super_edit->register_tinymce_button( array( 'name' => 'styleselect', 'nicename' => __( 'Custom CSS Classes', 'wp-super-edit' ), 'description' => __( 'Shows a drop down list of CSS Classes that the editor has access to.', 'wp-super-edit' ), 'provider' => 'wp-se-cssclasses', 'plugin' => 'supercssclasses', 'status' => 'no' )); } register_activation_hook( __FILE__, 'wp_super_css_classes_activate' ); /** * WP Super Class function to unregister items in WP Super Edit * Use $wp_super_edit primary object instance to remove settings from database using unregister_tinymce_plugin() and unregister_tinymce_button() for the registered items. * @global object $wp_super_edit */ function wp_super_css_classes_deactivate() { global $wp_super_edit; if ( empty( $wp_super_edit ) || !is_object( $wp_super_edit ) ) return false; // Unregister OLD WP Super Edit options for this plugin $wp_super_edit->unregister_tinymce_plugin( 'supercssclasses'); // Unregister Tiny MCE Buttons provided by this plugin $wp_super_edit->unregister_tinymce_button( 'styleselect' ); // DEPRECATE: Unregister WP Super Edit options for this plugin $wp_super_edit->unregister_tinymce_plugin( 'wp-super-class'); } register_deactivation_hook( __FILE__, 'wp_super_css_classes_deactivate' ); /** * WP Super Class custom CSS filter to add a theme/editor.css file to TinyMCE */ function wp_super_css_classes($mce_css) { if ( !empty( $mce_css ) ) $mce_css .= ','; $mce_css .= get_stylesheet_directory_uri() . '/editor.css'; return $mce_css; } add_filter('mce_css', 'wp_super_css_classes');