show_errors(); if(!function_exists('wpframe_add_editor_js')) { //Make sure multiple plugins can be created using WPFrame /// Adds the JS code needed for the editor. Changes often. So made it centralized function wpframe_add_editor_js() { wp_enqueue_script( 'common' ); wp_enqueue_script( 'jquery-color' ); wp_print_scripts('editor'); if (function_exists('add_thickbox')) add_thickbox(); wp_print_scripts('media-upload'); if (function_exists('wp_tiny_mce')) wp_tiny_mce(); wp_admin_css(); wp_enqueue_script('utils'); do_action("admin_print_styles-post-php"); do_action('admin_print_styles'); } /// Make sure that the user don't call this file directly - forces the use of the WP interface function wpframe_stop_direct_call($file) { if(preg_match('#' . basename($file) . '#', $_SERVER['PHP_SELF'])) die('Don\'t call this page directly.'); // Stop direct call } /// Shows a message in the admin interface of Wordpress function wpframe_message($message, $type='updated') { if($type == 'updated') $class = 'updated fade'; elseif($type == 'error') $class = 'updated error'; else $class = $type; print '
' . __($message, $GLOBALS['wpframe_plugin_name']) . '