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_Editorsclass exists, there is an editor on the current loaded admin page. See thewp_editor()function ingeneral-template.phpfile.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Change editor detecting function’ is closed to new replies.