• We are using the editor in a custom plugin:

    <?php
            // ...
            $settings = array(
                'teeny' => true,
                'textarea_rows' => 15,
                'tabindex' => 1
            );
            wp_editor(get_option('option_footer'), 'option_footer', $settings);
            submit_button();
            // ...

    The current editor checking function is:

    private function is_editor(){
    		if (!strstr($_SERVER['SCRIPT_NAME'],'post.php') && !strstr($_SERVER['SCRIPT_NAME'],'post-new.php')) {
    			return false;
    		}
    		return true;
    	}

    Maybe better solutin:

    private function is_editor(){
    		return class_exists( '_WP_Editors' );
    	}

    Because if the _WP_Editors class exists, there is an editor on the current loaded admin page. See the wp_editor() function in general-template.php file.

    https://ww.wp.xz.cn/plugins/html-editor-syntax-highlighter/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Change editor detecting function’ is closed to new replies.