Title: Change editor detecting function
Last modified: August 21, 2016

---

# Change editor detecting function

 *  [fchris82](https://wordpress.org/support/users/fchris82/)
 * (@fchris82)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/change-editor-detecting-function/)
 * 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://wordpress.org/plugins/html-editor-syntax-highlighter/](https://wordpress.org/plugins/html-editor-syntax-highlighter/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [fchris82](https://wordpress.org/support/users/fchris82/)
 * (@fchris82)
 * [11 years, 11 months ago](https://wordpress.org/support/topic/change-editor-detecting-function/#post-5099584)
 * Oh, sorry. The my solution is no good also!

Viewing 1 replies (of 1 total)

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

 * ![](https://ps.w.org/html-editor-syntax-highlighter/assets/icon.svg?rev=2013780)
 * [HTML Editor Syntax Highlighter](https://wordpress.org/plugins/html-editor-syntax-highlighter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/html-editor-syntax-highlighter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/html-editor-syntax-highlighter/)
 * [Active Topics](https://wordpress.org/support/plugin/html-editor-syntax-highlighter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/html-editor-syntax-highlighter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/html-editor-syntax-highlighter/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [fchris82](https://wordpress.org/support/users/fchris82/)
 * Last activity: [11 years, 11 months ago](https://wordpress.org/support/topic/change-editor-detecting-function/#post-5099584)
 * Status: not resolved