WordPress.org

Make WordPress Core

Ticket #28612: 28612.1.patch

File 28612.1.patch, 982 bytes (added by azaozz, 4 years ago)

Tweaked the patch a bit.

  • src/wp-includes/js/tinymce/plugins/wordpress/plugin.js

     
    566566                                wp.autosave.server.triggerSave();
    567567                        }
    568568                } );
     569
     570                if ( window.getUserSetting( 'editor_plain_text_paste_warning' ) > 1 ) {
     571                        editor.settings.paste_plaintext_inform = false;
     572                }
    569573        } );
    570574
     575        editor.on( 'PastePlainTextToggle', function( event ) {
     576                // Warn twice, then stop.
     577                if ( event.state === true ) {
     578                        var times = parseInt( window.getUserSetting( 'editor_plain_text_paste_warning' ), 10 ) || 0;
     579
     580                        if ( times < 2 ) {
     581                                window.setUserSetting( 'editor_plain_text_paste_warning', ++times );
     582                        }
     583                }
     584        });
     585
    571586        /**
    572587         * Experimental: create a floating toolbar.
    573588         * This functionality will change in the next releases. Not recommended for use by plugins.