• I’m using the following function to allow input elements in TinyMCE, but it doesnt work with the editor role.

    When i log in as an administrator the function works fine and the input-element is kept in the source code. When i log in as editor the element is removed from the source code.

    How can i make the input tag valid for editor users ?

    function my_valid_elements($initArray) {
        $elements = array(
          'input' => 'input[id|name|class|style|value|type|checked|disabled|tabindex|accesskey|maxlength]'
        ); 
    
        $ext = implode(',', $elements);
        if ( isset( $initArray['extended_valid_elements'] ) ) {
            $initArray['extended_valid_elements'] .= ',' . $ext;
        } else {
            $initArray['extended_valid_elements'] = $ext;
        }
        return $initArray;
    }
    add_filter('tiny_mce_before_init', 'my_valid_elements');
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[TinyMCE] Extended_valid_elements for editor role’ is closed to new replies.