• rselvakaruppasamy

    (@rselvakaruppasamy)


    Hi,
    I have a problem on this editor method which is located in class-wp-editor.php file. I want to remove this esc_attr without modify the wordpress core file, how to extend to my theme and remove this.

    $the_editor = apply_filters( ‘the_editor’, ‘<div id=”wp-‘ . $editor_id_attr . ‘-editor-container” class=”wp-editor-container”>’ .
    $quicktags_toolbar .
    ‘<textarea’ . $editor_class . $height . $tabindex . $autocomplete . ‘ cols=”40″ name=”‘ . esc_attr( $set[‘textarea_name’] ) . ‘” ‘ .
    ‘id=”‘ . $editor_id_attr . ‘”>%s</textarea></div>’ );

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You alter the final output of the editor by hooking ‘the_editor’ filter with add_filter('the_editor', 'my_editor_callback');

    The function my_editor_callback() is of your own making. It could use str_replace() or preg_replace() to alter anything in the resulting HTML.

    Of course esc_attr() will have already been executed, but you could put back whatever it was that causes you to want to remove esc_attr() in the first place. Why would you want to remove esc_attr()? It is there as a security and compliance measure. In any case, in the filter callback you can make the name anything you want. Just be sure the source for what you put in is secure from script injection and is W3C compliant.

    Thread Starter rselvakaruppasamy

    (@rselvakaruppasamy)

    Thanks a lot i have used preg_replace() it is working now

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to extend the_editor into theme’ is closed to new replies.