core_path . 'wp-super-edit-defaults.php'); } $wp_super_edit_run_mode = apply_filters( 'wp_super_edit_run_mode', $wp_super_edit_run_mode ); /** * @internal: Conditional activation for WP Super Edit interfaces */ switch( $wp_super_edit_run_mode ) { // Minimal WP Super Edit usage case 'core': $wp_super_edit = new wp_super_edit_core(); add_action('init', 'wp_super_edit_init', 5); break; // WP Super Edit Administration interfaces and default manipulation of TinyMCE. case 'admin': $wp_super_edit = new wp_super_edit_admin(); load_plugin_textdomain( 'wp-super-edit', WP_PLUGIN_DIR . '/' .dirname(plugin_basename(__FILE__)) . '/languages', dirname(plugin_basename(__FILE__)) . '/languages' ); add_action('init', 'wp_super_edit_init', 5); add_action('admin_menu', 'wp_super_edit_admin_menu_setup'); add_action('admin_init', 'wp_super_edit_admin_setup'); add_filter('mce_external_plugins','wp_super_edit_tinymce_plugin_filter', 99); add_filter('tiny_mce_before_init','wp_super_edit_tinymce_filter', 99); } /** * WP Super Edit Initialization * * This function used by Wordpress to initialize this application. Some TinyMCE * plugins used in WP Super Edit may have callback functions that need to run * @global object $wp_super_edit */ function wp_super_edit_init() { global $wp_super_edit; if ( !$wp_super_edit->is_installed ) return; foreach ( $wp_super_edit->plugins as $plugin_name => $plugin ) { if ( $plugin->status == 'no' ) continue; if ( strlen( $plugin->callbacks ) < 2 ) continue; $callbacks = explode( ',', $plugin->callbacks ); foreach ( $callbacks as $callback => $command ) { if ( !function_exists( $command ) ) continue; call_user_func( trim( $command ) ); } } } /** * WP Super Edit TinyMCE filter * * This function is a WordPress filter designed to replace the TinyMCE configuration array * with the configuration array created by WP Super Edit. * @global object $wp_super_edit */ function wp_super_edit_tinymce_filter( $initArray ) { global $wp_super_edit; if ( !$wp_super_edit->is_installed ) return $initArray; $initArray = $wp_super_edit->tinymce_settings( $initArray ); return $initArray; } /** * WP Super Edit TinyMCE Plugin filter * * This WordPress filter passes plugins activated by WP Super Edit and passes them during init of * TinyMCE. * @global object $wp_super_edit */ function wp_super_edit_tinymce_plugin_filter( $tinymce_plugins ) { global $wp_super_edit; if ( !$wp_super_edit->is_installed ) return $tinymce_plugins; if ( !is_array( $wp_super_edit->plugins ) ) return; foreach( $wp_super_edit->plugins as $plugin ) { if ( $plugin->status != 'yes' ) continue; if ( $plugin->provider == 'tinymce' ) continue; if ( $plugin->url != '' ) { if ( preg_match("/^(http:|https:)/i", $plugin->url ) ) { $tinymce_plugins[$plugin->name] = $plugin->url; } else { $tinymce_plugins[$plugin->name] = $wp_super_edit->tinymce_plugins_uri . $plugin->name . $plugin->url; } } else { $tinymce_plugins[$plugin->name] = $wp_super_edit->tinymce_plugins_uri . $plugin->name . '/editor_plugin.js'; } } return $tinymce_plugins; } do_action( 'wp_super_edit_loaded', 'wp_super_edit_loaded' ); print_r($wp_super_edit); ?>