Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter travaudoma

    (@travaudoma)

    I really hope this plugin is still supported and help me make it better.
    i try add wp_enqueue_code_editor together with plugins

    add_action( 'admin_print_styles-toplevel_page_wpcf7', function () {
    	if ( empty( $_GET['post'] ) ) {
    		return;
    	}
    	$settings = wp_enqueue_code_editor( array( 'type' => 'text/html' ) );
    	if ( false === $settings ) {
    		return;
    	}
    	wp_add_inline_script('code-editor', sprintf( 'jQuery( function() { wp.codeEditor.initialize( "wpcf7-form", %s ); } );', wp_json_encode( $settings ) ));
    	wp_add_inline_script('code-editor', sprintf( 'jQuery( function() { wp.codeEditor.initialize( "wpcf7-mail-body", %s ); } );', wp_json_encode( $settings ) ));
    	wp_add_inline_script('code-editor', sprintf( 'jQuery( function() { wp.codeEditor.initialize( "wpcf7-mail-2-body", %s ); } );', wp_json_encode( $settings ) ));
    
    } );

    and am faced with a problem
    codemirror completely replaces tinymce in two modes (use HTML/notuse HTML)
    how it fixed?
    i try change id in
    if( jQuery('#wpcf7-mail-use-html').prop('checked') ) tinymce_elements.push('wpcf7-mail-body');
    to
    if( jQuery('#wpcf7-mail-use-html').prop('checked') ) tinymce_elements.push('id_tinymce');
    but id keeps changing after page load

    maybe in next release your will add codemirror to tinymce?
    regards

    • This reply was modified 3 years, 6 months ago by travaudoma.
    • This reply was modified 3 years, 6 months ago by travaudoma.
    • This reply was modified 3 years, 6 months ago by travaudoma.
    • This reply was modified 3 years, 6 months ago by travaudoma.
    Thread Starter travaudoma

    (@travaudoma)

    how can i specify tinymce_elements to work together codemirror and tinymce?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How switch to text’ is closed to new replies.