main_file = str_replace('-class', '', __FILE__); $this->plugin_url = WP_PLUGIN_URL . '/' . basename(dirname($this->main_file)); if (strpos($this->plugin_url, 'http') === 0 && is_ssl()) $this->plugin_url = str_replace('http://', 'https://', $this->plugin_url); // Register (de)activation hook register_activation_hook($this->main_file, array(&$this, 'Activate')); register_deactivation_hook($this->main_file, array(&$this, 'Deactivate')); // Register actions add_action('init', array(&$this, 'Init'), 0); if (is_admin()) { if (WPShortcodeExecPHP::Is_multisite() && is_plugin_active_for_network(plugin_basename($this->main_file)) && version_compare($wp_version, '3.1') >= 0) add_action('network_admin_menu', array(&$this, 'Admin_menu_network')); else add_action('admin_menu', array(&$this, 'Admin_menu')); add_action('wp_ajax_scep_ajax', array(&$this, 'Check_ajax')); } // Enable shortcodes for widgets if (WPShortcodeExecPHP::Get_option(c_scep_option_widget)) add_filter('widget_text', 'do_shortcode'); // Enable shortcodes for excerpts if (WPShortcodeExecPHP::Get_option(c_scep_option_excerpt)) { add_filter('the_excerpt', 'do_shortcode'); if (WPShortcodeExecPHP::Get_option(c_scep_option_comment)) add_filter('comment_excerpt', 'do_shortcode'); } // Enable shortcodes for comments if (WPShortcodeExecPHP::Get_option(c_scep_option_comment)) add_filter('comment_text', 'do_shortcode'); // Enable shortcodes for RSS if (WPShortcodeExecPHP::Get_option(c_scep_option_rss)) { if (version_compare($wp_version, '2.9') < 0) add_filter('the_content_rss', 'do_shortcode'); else add_filter('the_content_feed', 'do_shortcode'); if (WPShortcodeExecPHP::Get_option(c_scep_option_excerpt)) add_filter('the_excerpt_rss', 'do_shortcode'); if (WPShortcodeExecPHP::Get_option(c_scep_option_comment)) add_filter('comment_text_rss', 'do_shortcode'); } // Wire shortcode handlers $name = WPShortcodeExecPHP::Get_option(c_scep_option_names); for ($i = 0; $i < count($name); $i++) if (WPShortcodeExecPHP::Get_option(c_scep_option_enabled . $name[$i])) add_shortcode($name[$i], array(&$this, 'Shortcode_handler')); $this->default_backtrack_limit = ini_get('pcre.backtrack_limit'); $this->default_recursion_limit = ini_get('pcre.recursion_limit'); $this->Configure_prce(); } function Configure_prce() { $backtrack_limit = WPShortcodeExecPHP::Get_option(c_scep_option_backtrack_limit); if ($backtrack_limit < $this->default_backtrack_limit) $backtrack_limit = $this->default_backtrack_limit; @ini_set('pcre.backtrack_limit', $backtrack_limit); $recursion_limit = WPShortcodeExecPHP::Get_option(c_scep_option_recursion_limit); if ($recursion_limit < $this->default_recursion_limit) $recursion_limit = $this->default_recursion_limit; @ini_set('pcre.recursion_limit', $recursion_limit); } function Init() { if (is_admin()) { // I18n load_plugin_textdomain(c_scep_text_domain, false, dirname(plugin_basename(__FILE__))); // Enqueue scripts wp_enqueue_script('jquery'); $plugin_dir = '/' . PLUGINDIR . '/' . basename(dirname($this->main_file)); wp_enqueue_script('editarea', $plugin_dir . '/editarea/edit_area/edit_area_full.js'); // Enqueue style sheet $css_name = $this->Change_extension(basename($this->main_file), '.css'); if (file_exists(WP_CONTENT_DIR . '/uploads/' . $css_name)) $css_url = WP_CONTENT_URL . '/uploads/' . $css_name; else if (file_exists(TEMPLATEPATH . '/' . $css_name)) $css_url = get_bloginfo('template_directory') . '/' . $css_name; else $css_url = $this->plugin_url . '/' . $css_name; wp_register_style('scep_style', $css_url); wp_enqueue_style('scep_style'); // Make sure capabilities are set if (!WPShortcodeExecPHP::Get_option(c_scep_option_tinymce_cap)) WPShortcodeExecPHP::Update_option(c_scep_option_tinymce_cap, 'edit_posts'); if (!WPShortcodeExecPHP::Get_option(c_scep_option_author_cap)) WPShortcodeExecPHP::Update_option(c_scep_option_author_cap, 'edit_posts'); // http://codex.wordpress.org/TinyMCE_Custom_Buttons if (WPShortcodeExecPHP::Get_option(c_scep_option_tinymce) && current_user_can(WPShortcodeExecPHP::Get_option(c_scep_option_tinymce_cap)) && current_user_can(WPShortcodeExecPHP::Get_option(c_scep_option_author_cap))) if (current_user_can('edit_posts') || current_user_can('edit_pages')) if (get_user_option('rich_editing') == 'true') { add_filter('tiny_mce_version', array(&$this, 'TinyMCE_version') ); add_filter('mce_external_plugins', array(&$this, 'TinyMCE_plugin')); add_filter('mce_buttons', array(&$this, 'TinyMCE_button')); } } } // Handle plugin activation function Activate() { if (!WPShortcodeExecPHP::Get_option(c_scep_option_codewidth)) WPShortcodeExecPHP::Update_option(c_scep_option_codewidth, 600); if (!WPShortcodeExecPHP::Get_option(c_scep_option_codeheight)) WPShortcodeExecPHP::Update_option(c_scep_option_codeheight, 200); if (!WPShortcodeExecPHP::Get_option(c_scep_option_names)) { // Define example shortcode $name = array(); $name[] = 'hello_world'; WPShortcodeExecPHP::Update_option(c_scep_option_names, $name); WPShortcodeExecPHP::Update_option(c_scep_option_enabled . $name[0], true); WPShortcodeExecPHP::Update_option(c_scep_option_buffer . $name[0], true); WPShortcodeExecPHP::Update_option(c_scep_option_description . $name[0], 'Example'); $phpcode = "extract(shortcode_atts(array('arg' => 'default'), \$atts));" . PHP_EOL; $phpcode .= "echo \"Hello world!\" . PHP_EOL;" . PHP_EOL; $phpcode .= "echo \"Arg=\" . \$arg . PHP_EOL;" . PHP_EOL; $phpcode .= "echo \"Content=\" . \$content . PHP_EOL;" . PHP_EOL; WPShortcodeExecPHP::Update_option(c_scep_option_phpcode . $name[0], $phpcode); } // Fix spelling mistake if (WPShortcodeExecPHP::Get_option('scep_backtrace_limit')) { WPShortcodeExecPHP::Update_option(c_scep_option_backtrack_limit, WPShortcodeExecPHP::Get_option('scep_backtrace_limit')); WPShortcodeExecPHP::Delete_option('scep_backtrace_limit'); } if (!WPShortcodeExecPHP::Get_option(c_scep_option_tinymce_cap)) WPShortcodeExecPHP::Update_option(c_scep_option_tinymce_cap, 'edit_posts'); if (!WPShortcodeExecPHP::Get_option(c_scep_option_author_cap)) WPShortcodeExecPHP::Update_option(c_scep_option_author_cap, 'edit_posts'); } // Handle plugin deactivation function Deactivate() { // Cleanup if requested if (WPShortcodeExecPHP::Get_option(c_scep_option_cleanup)) { delete_site_option(c_scep_option_global); WPShortcodeExecPHP::Delete_option(c_scep_option_widget); WPShortcodeExecPHP::Delete_option(c_scep_option_excerpt); WPShortcodeExecPHP::Delete_option(c_scep_option_comment); WPShortcodeExecPHP::Delete_option(c_scep_option_rss); WPShortcodeExecPHP::Delete_option(c_scep_option_noent); WPShortcodeExecPHP::Delete_option(c_scep_option_codewidth); WPShortcodeExecPHP::Delete_option(c_scep_option_codeheight); WPShortcodeExecPHP::Delete_option(c_scep_option_editarea_later); WPShortcodeExecPHP::Delete_option(c_scep_option_backtrack_limit); WPShortcodeExecPHP::Delete_option(c_scep_option_recursion_limit); WPShortcodeExecPHP::Delete_option(c_scep_option_cleanup); WPShortcodeExecPHP::Delete_option(c_scep_option_donated); $name = WPShortcodeExecPHP::Get_option(c_scep_option_names); for ($i = 0; $i < count($name); $i++) { WPShortcodeExecPHP::Delete_option(c_scep_option_enabled . $name[$i]); WPShortcodeExecPHP::Delete_option(c_scep_option_buffer . $name[$i]); WPShortcodeExecPHP::Delete_option(c_scep_option_description . $name[$i]); WPShortcodeExecPHP::Delete_option(c_scep_option_param . $name[$i]); WPShortcodeExecPHP::Delete_option(c_scep_option_phpcode . $name[$i]); } WPShortcodeExecPHP::Delete_option(c_scep_option_names); } } // Admin head function Admin_head() { // Initialize EditArea $name = WPShortcodeExecPHP::Get_option(c_scep_option_names); $display = WPShortcodeExecPHP::Get_option(c_scep_option_editarea_later) ? 'later' : 'onload'; echo '' . PHP_EOL; } // Register options page function Admin_menu() { if (WPShortcodeExecPHP::Is_multisite()) { if (function_exists('add_submenu_page')) $plugin_page = add_submenu_page( 'wpmu-admin.php', __('Shortcode Exec PHP Administration', c_scep_text_domain), __('Shortcode Exec PHP', c_scep_text_domain), 'manage_network', $this->main_file, array(&$this, 'Administration')); } else { if (function_exists('add_options_page')) $plugin_page = add_options_page( __('Shortcode Exec PHP Administration', c_scep_text_domain), __('Shortcode Exec PHP', c_scep_text_domain), 'manage_options', $this->main_file, array(&$this, 'Administration')); if (function_exists('add_submenu_page')) $tools_page = add_submenu_page( 'tools.php', __('Shortcode Exec PHP Administration', c_scep_text_domain), __('Shortcode Exec PHP', c_scep_text_domain), 'manage_options', $this->main_file, array(&$this, 'Administration')); } // Hook admin head for option page if (!empty($plugin_page)) add_action('admin_head-' . $plugin_page, array(&$this, 'Admin_head')); if (!empty($tools_page)) add_action('admin_head-' . $tools_page, array(&$this, 'Admin_head')); } function Admin_menu_network() { if (function_exists('add_submenu_page')) $plugin_page = add_submenu_page( 'settings.php', __('Shortcode Exec PHP Administration', c_scep_text_domain), __('Shortcode Exec PHP', c_scep_text_domain), 'manage_network', $this->main_file, array(&$this, 'Administration')); // Hook admin head for option page if (!empty($plugin_page)) add_action('admin_head-' . $plugin_page, array(&$this, 'Admin_head')); } // Handle option page function Administration() { // Secirity check if (!current_user_can(WPShortcodeExecPHP::Is_multisite() ? 'manage_network' : 'manage_options')) die('Unauthorized'); // Check post back if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { // Check security check_admin_referer(c_scep_nonce_form); if (empty($_POST[c_scep_option_global])) $_POST[c_scep_option_global] = null; if (empty($_POST[c_scep_option_widget])) $_POST[c_scep_option_widget] = null; if (empty($_POST[c_scep_option_excerpt])) $_POST[c_scep_option_excerpt] = null; if (empty($_POST[c_scep_option_comment])) $_POST[c_scep_option_comment] = null; if (empty($_POST[c_scep_option_rss])) $_POST[c_scep_option_rss] = null; if (empty($_POST[c_scep_option_noent])) $_POST[c_scep_option_noent] = null; if (empty($_POST[c_scep_option_editarea_later])) $_POST[c_scep_option_editarea_later] = null; if (empty($_POST[c_scep_option_tinymce])) $_POST[c_scep_option_tinymce] = null; if (empty($_POST[c_scep_option_cleanup])) $_POST[c_scep_option_cleanup] = null; if (empty($_POST[c_scep_option_donated])) $_POST[c_scep_option_donated] = null; // Update settings if (WPShortcodeExecPHP::Is_multisite() && function_exists('update_site_option')) update_site_option(c_scep_option_global, $_POST[c_scep_option_global]); WPShortcodeExecPHP::Update_option(c_scep_option_widget, $_POST[c_scep_option_widget]); WPShortcodeExecPHP::Update_option(c_scep_option_excerpt, $_POST[c_scep_option_excerpt]); WPShortcodeExecPHP::Update_option(c_scep_option_comment, $_POST[c_scep_option_comment]); WPShortcodeExecPHP::Update_option(c_scep_option_rss, $_POST[c_scep_option_rss]); WPShortcodeExecPHP::Update_option(c_scep_option_noent, $_POST[c_scep_option_noent]); WPShortcodeExecPHP::Update_option(c_scep_option_codewidth, trim($_POST[c_scep_option_codewidth])); WPShortcodeExecPHP::Update_option(c_scep_option_codeheight, trim($_POST[c_scep_option_codeheight])); WPShortcodeExecPHP::Update_option(c_scep_option_editarea_later, $_POST[c_scep_option_editarea_later]); WPShortcodeExecPHP::Update_option(c_scep_option_backtrack_limit, trim($_POST[c_scep_option_backtrack_limit])); WPShortcodeExecPHP::Update_option(c_scep_option_recursion_limit, trim($_POST[c_scep_option_recursion_limit])); WPShortcodeExecPHP::Update_option(c_scep_option_tinymce, $_POST[c_scep_option_tinymce]); WPShortcodeExecPHP::Update_option(c_scep_option_tinymce_cap, $_POST[c_scep_option_tinymce_cap]); WPShortcodeExecPHP::Update_option(c_scep_option_author_cap, $_POST[c_scep_option_author_cap]); WPShortcodeExecPHP::Update_option(c_scep_option_cleanup, $_POST[c_scep_option_cleanup]); WPShortcodeExecPHP::Update_option(c_scep_option_donated, $_POST[c_scep_option_donated]); $this->Configure_prce(); // Copy options to site wide if ($_POST[c_scep_option_global] && WPShortcodeExecPHP::Is_multisite() && function_exists('update_site_option')) { $name = get_option(c_scep_option_names); update_site_option(c_scep_option_names, $name); for ($i = 0; $i < count($name); $i++) { update_site_option(c_scep_option_enabled . $name[$i], get_option(c_scep_option_enabled . $name[$i])); update_site_option(c_scep_option_buffer . $name[$i], get_option(c_scep_option_buffer . $name[$i])); update_site_option(c_scep_option_description . $name[$i], get_option(c_scep_option_description . $name[$i])); update_site_option(c_scep_option_param . $name[$i], get_option(c_scep_option_param . $name[$i])); update_site_option(c_scep_option_phpcode . $name[$i], get_option(c_scep_option_phpcode . $name[$i])); } } echo '

' . __('Settings updated', c_scep_text_domain) . '

'; } echo '
'; // Get shortcodes $name = WPShortcodeExecPHP::Get_option(c_scep_option_names); WPShortcodeExecPHP::Update_option(c_scep_option_deleted, 0); usort($name, 'strcasecmp'); // Render shortcuts if (count($name)) { echo '' . __('Go to', c_scep_text_domain); for ($i = 0; $i < count($name); $i++) { echo ($i ? ', ' : ' '); echo '' . $name[$i] . ''; } echo ''; } // Render info panel $this->Render_info_panel(); echo '
'; // Render title echo '

' . __('Shortcode Exec PHP Administration', c_scep_text_domain) . '

'; // Render options form echo '
'; // Security wp_nonce_field(c_scep_nonce_form); $nonce = wp_create_nonce(c_scep_nonce_ajax); // Get current settings $scep_global = (WPShortcodeExecPHP::Is_multisite() && function_exists('get_site_option') && get_site_option(c_scep_option_global) ? 'checked="checked"' : ''); $scep_widget = (WPShortcodeExecPHP::Get_option(c_scep_option_widget) ? 'checked="checked"' : ''); $scep_excerpt = (WPShortcodeExecPHP::Get_option(c_scep_option_excerpt) ? 'checked="checked"' : ''); $scep_comment = (WPShortcodeExecPHP::Get_option(c_scep_option_comment) ? 'checked="checked"' : ''); $scep_rss = (WPShortcodeExecPHP::Get_option(c_scep_option_rss) ? 'checked="checked"' : ''); $scep_noent = (WPShortcodeExecPHP::Get_option(c_scep_option_noent) ? 'checked="checked"' : ''); $scep_width = (WPShortcodeExecPHP::Get_option(c_scep_option_codewidth)); $scep_height = (WPShortcodeExecPHP::Get_option(c_scep_option_codeheight)); $scep_editarea_later = (WPShortcodeExecPHP::Get_option(c_scep_option_editarea_later) ? 'checked="checked"' : ''); $scep_backtrack_limit = (WPShortcodeExecPHP::Get_option(c_scep_option_backtrack_limit)); $scep_recursion_limit = (WPShortcodeExecPHP::Get_option(c_scep_option_recursion_limit)); $scep_option_tinymce = (WPShortcodeExecPHP::Get_option(c_scep_option_tinymce) ? 'checked="checked"' : ''); $scep_option_tinymce_cap = WPShortcodeExecPHP::Get_option(c_scep_option_tinymce_cap); $scep_option_author_cap = WPShortcodeExecPHP::Get_option(c_scep_option_author_cap); $scep_cleanup = (WPShortcodeExecPHP::Get_option(c_scep_option_cleanup) ? 'checked="checked"' : ''); $scep_donated = (WPShortcodeExecPHP::Get_option(c_scep_option_donated) ? 'checked="checked"' : ''); // Default size if ($scep_width <= 0) $scep_width = 600; if ($scep_height <= 0) $scep_height = 200; // Get list of capabilities global $wp_roles; $capabilities = array(); foreach ($wp_roles->role_objects as $key => $role) if (is_array($role->capabilities)) foreach ($role->capabilities as $cap => $grant) $capabilities[$cap] = $cap; sort($capabilities); // Render options ?>

/>
/>
/>
/>
/>
/>
px
px
/>
()
()
/>
/>
/>

Render_shortcode_form($name[$i], $i + 1, $description, $enabled, $buffer, $code); } ?>
[]
wait

[shortcode arg="value"] extract(shortcode_atts(array('arg' => 'default'), $atts));
[shortcode]content[/shortcode] $content
'; } ?>
[] > >
' . __('Last attributes:', c_scep_text_domain) . ' '; echo substr(print_r($params, true), 6); echo '
wait

TinyMCE_handle(); exit(); } // Security check $nonce = $_REQUEST[c_scep_param_nonce]; if (!wp_verify_nonce($nonce, c_scep_nonce_ajax)) die('Unauthorized'); // Send header header('Content-Type: text/html; charset=' . get_option('blog_charset')); // Load text domain load_plugin_textdomain(c_scep_text_domain, false, basename(dirname($this->main_file))); if (empty($_REQUEST[c_scep_param_name])) $_REQUEST[c_scep_param_name] = null; if (empty($_REQUEST[c_scep_param_shortcode])) $_REQUEST[c_scep_param_shortcode] = null; if (empty($_REQUEST[c_scep_param_description])) $_REQUEST[c_scep_param_description] = null; if (empty($_REQUEST[c_scep_param_phpcode])) $_REQUEST[c_scep_param_phpcode] = null; if (empty($_REQUEST[c_scep_param_enabled])) $_REQUEST[c_scep_param_enabled] = false; else if ($_REQUEST[c_scep_param_enabled] == 'true') $_REQUEST[c_scep_param_enabled] = true; else if ($_REQUEST[c_scep_param_enabled] == 'checked') $_REQUEST[c_scep_param_enabled] = true; else $_REQUEST[c_scep_param_enabled] = false; if (empty($_REQUEST[c_scep_param_buffer])) $_REQUEST[c_scep_param_buffer] = false; else if ($_REQUEST[c_scep_param_buffer] == 'true') $_REQUEST[c_scep_param_buffer] = true; else if ($_REQUEST[c_scep_param_buffer] == 'checked') $_REQUEST[c_scep_param_buffer] = true; else $_REQUEST[c_scep_param_buffer] = false; // Decode parameters $name = stripslashes($_REQUEST[c_scep_param_name]); $shortcode = trim(stripslashes($_REQUEST[c_scep_param_shortcode])); $enabled = $_REQUEST[c_scep_param_enabled]; $buffer = $_REQUEST[c_scep_param_buffer]; $description = trim(stripslashes($_REQUEST[c_scep_param_description])); $phpcode = $_REQUEST[c_scep_param_phpcode]; if (!WPShortcodeExecPHP::Get_option(c_scep_option_noent)) $phpcode = html_entity_decode($phpcode, ENT_NOQUOTES); $phpcode = stripslashes($phpcode); // Save, test if ($_POST[c_scep_action_arg] == c_scep_action_save || $_POST[c_scep_action_arg] == c_scep_action_test) { // Persist new definition $names = WPShortcodeExecPHP::Get_option(c_scep_option_names); for ($i = 0; $i < count($names); $i++) if ($names[$i] == $name) { remove_shortcode($name); WPShortcodeExecPHP::Delete_option(c_scep_option_enabled . $name); WPShortcodeExecPHP::Delete_option(c_scep_option_buffer . $name); WPShortcodeExecPHP::Delete_option(c_scep_option_description . $name); WPShortcodeExecPHP::Delete_option(c_scep_option_param . $name); WPShortcodeExecPHP::Delete_option(c_scep_option_phpcode . $name); $names[$i] = $shortcode; break; } WPShortcodeExecPHP::Update_option(c_scep_option_names, $names); WPShortcodeExecPHP::Update_option(c_scep_option_enabled . $shortcode, $enabled); WPShortcodeExecPHP::Update_option(c_scep_option_buffer . $shortcode, $buffer); WPShortcodeExecPHP::Update_option(c_scep_option_description . $shortcode, $description); WPShortcodeExecPHP::Update_option(c_scep_option_phpcode . $shortcode, $phpcode); if ($_POST[c_scep_action_arg] == c_scep_action_save) echo __('Saved', c_scep_text_domain); else // Test shortcode if ($enabled) { ob_start(); $result = eval($phpcode); $output = ob_get_contents(); ob_end_clean(); if ($buffer) { $result = $output . $result; $output = false; } echo '[' . $shortcode . ']="' . $result . '"'; if ($output) { echo PHP_EOL . __('Unexpected output, do not use ECHO but RETURN', c_scep_text_domain); echo PHP_EOL . '"' . $output . '"'; } } else echo '[' . $shortcode . '] ' . __('not enabled', c_scep_text_domain); } // Revert else if ($_POST[c_scep_action_arg] == c_scep_action_revert) echo WPShortcodeExecPHP::Get_option(c_scep_option_phpcode . $name, $phpcode); // Delete else if ($_POST[c_scep_action_arg] == c_scep_action_delete) { $names = WPShortcodeExecPHP::Get_option(c_scep_option_names); for ($i = 0; $i < count($names); $i++) if ($names[$i] == $name) { remove_shortcode($name[$i]); array_splice($names, $i, 1); break; } WPShortcodeExecPHP::Update_option(c_scep_option_names, $names); WPShortcodeExecPHP::Delete_option(c_scep_option_enabled . $name); WPShortcodeExecPHP::Delete_option(c_scep_option_buffer . $name); WPShortcodeExecPHP::Delete_option(c_scep_option_description . $name); WPShortcodeExecPHP::Delete_option(c_scep_option_param . $name); WPShortcodeExecPHP::Delete_option(c_scep_option_phpcode . $name); WPShortcodeExecPHP::Update_option(c_scep_option_deleted, WPShortcodeExecPHP::Get_option(c_scep_option_deleted) + 1); } // New else if ($_POST[c_scep_action_arg] == c_scep_action_new) { // Check unique $names = WPShortcodeExecPHP::Get_option(c_scep_option_names); for ($i = 0; $i < count($names); $i++) if ($names[$i] == $shortcode) { echo '0|' . __('Shortcode exists', c_scep_text_domain); exit(); } if ($shortcode) { $names = WPShortcodeExecPHP::Get_option(c_scep_option_names); $names[] = $shortcode; WPShortcodeExecPHP::Update_option(c_scep_option_names, $names); WPShortcodeExecPHP::Add_option(c_scep_option_enabled . $shortcode, true); WPShortcodeExecPHP::Add_option(c_scep_option_buffer . $shortcode, true); WPShortcodeExecPHP::Add_option(c_scep_option_description . $shortcode, ''); WPShortcodeExecPHP::Add_option(c_scep_option_phpcode . $shortcode, $phpcode); $index = count($names) + WPShortcodeExecPHP::Get_option(c_scep_option_deleted); echo $index . '|'; echo $this->Render_shortcode_form($shortcode, $index, '', true, true, $phpcode); } else { echo '0|' . __('Name missing', c_scep_text_domain); exit(); } } // Otherwise else die('Unknown request'); exit(); } } // TinyMCE integration function TinyMCE_version($version) { return $version . 'scep'; } function TinyMCE_plugin($plugins) { $plugins['ShortcodeExecPHP'] = $this->plugin_url . '/tinymce/shortcode.js'; return $plugins; } function TinyMCE_button($buttons) { array_push($buttons, 'separator', 'ShortcodeExecPHP'); return $buttons; } function TinyMCE_handle() { // Load text domain load_plugin_textdomain(c_scep_text_domain, false, basename(dirname($this->main_file))); $names = WPShortcodeExecPHP::Get_option(c_scep_option_names); // Send header header('Content-Type: text/html; charset=' . get_option('blog_charset')); ?> Shortcode

' . htmlspecialchars($description) . '

'; } ?>