tag, then the tag will be highlighted using a class named aphph-pretag-focused * so we need to remove it before save into database */ add_action( 'content_save_pre', array($this, 'clean_tag'), 10, 2 ); $this->options = get_option(APHPH_OPTION); $this->options_phdata = get_option(APHPH_OPTION_PHDATA); } public function admin_comments_form ($screen) { if ($screen->id == 'edit-comments') { $this->add_modal_dialog(); } } public function add_modal_dialog() { $lang_list = $this->options['lang-used']; $lang_options = ''; foreach ($lang_list as $lang) { if ($lang == 'core') continue; $item = $this->options_phdata['lang-list'][$lang]; if ($item) { $title = $item; if (is_array($item)) { $title = $item['title']; if (key_exists('aliasTitles', $item)) { $title .= ' / ' . join($item['aliasTitles'], ' / '); } } $selected = $lang == $this->options['default-lang'] ? ' selected="selected"' : ''; $lang_options .= ''; } } echo '
APH Prism Highlighter
Language
Highlight Line e.q: 1,2,3-6

Other Options

'; /* Options, used to change the language dropdown menu to default value, * we don,t use global variable, so we use this */ echo ''; } public function aphph_button() { add_filter( 'mce_external_plugins', array($this, 'aphph_add_buttons') ); add_filter( 'mce_buttons', array($this, 'aphph_register_buttons') ); } public function aphph_add_buttons( $plugin_array ) { $plugin_array['aphph_tinymce_btn'] = APHPH_PLUGIN_URL . '/js/aphph-tinymce.js?r='.time(); return $plugin_array; } public function aphph_register_buttons( $buttons ) { array_push( $buttons, 'aphph'); return $buttons; } private function register_scripts() { wp_enqueue_style('aphph-code-editor', APHPH_PLUGIN_URL . '/css/aphph-code-editor.css'); wp_enqueue_style('aphph-icomoon', APHPH_PLUGIN_URL . '/css/icomoon/style.css'); wp_enqueue_script('aphph-taboverride', APHPH_PLUGIN_URL . '/js/taboverride/taboverride.min.js'); wp_enqueue_script('aphph-admin-editor', APHPH_PLUGIN_URL . '/js/aphph-admin-editor.js', 'jquery', ''); } // Add editor to admin comment public function register_scripts_comments($screen) { if ($screen->id == 'edit-comments') { $this->register_scripts(); } } // Add editor to add or edit post / page public function register_scripts_post($hook) { if ( $hook == 'post-new.php' || $hook == 'post.php' ) { $this->register_scripts(); } } public function aphph_tinymce_editor_css($wp) { $wp .= ',' . APHPH_PLUGIN_URL . '/css/aphph-tinymce-editor.css'; return $wp; } public function clean_tag($content) { return preg_replace('/\s*aphph-pretag-focused\s*/', '', $content); } }