Classic Editor - Version 1.6

Version Description

  • Updated for WordPress 5.5.
  • Fixed minor issues with calling deprecated functions, needlessly registering uninstall hook, and capitalization of some strings.
Download this release

Release Info

Developer azaozz
Plugin Icon 128x128 Classic Editor
Version 1.6
Comparing to
See all releases

Code changes from version 1.5 to 1.6

Files changed (4) hide show
  1. LICENSE.md +400 -400
  2. classic-editor.php +45 -33
  3. js/block-editor-plugin.js +1 -1
  4. readme.txt +20 -16
LICENSE.md CHANGED
@@ -1,400 +1,400 @@
1
- ### WordPress - Web publishing software
2
-
3
- Copyright 2011-2019 by the contributors
4
-
5
- This program is free software; you can redistribute it and/or modify
6
- it under the terms of the GNU General Public License as published by
7
- the Free Software Foundation; either version 2 of the License, or
8
- (at your option) any later version.
9
-
10
- This program is distributed in the hope that it will be useful,
11
- but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- GNU General Public License for more details.
14
-
15
- You should have received a copy of the GNU General Public License
16
- along with this program; if not, write to the Free Software
17
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
-
19
- This program incorporates work covered by the following copyright and
20
- permission notices:
21
-
22
- b2 is (c) 2001, 2002 Michel Valdrighi - m@tidakada.com -
23
- http://tidakada.com
24
-
25
- Wherever third party code has been used, credit has been given in the code's
26
- comments.
27
-
28
- b2 is released under the GPL
29
-
30
- and
31
-
32
- WordPress - Web publishing software
33
-
34
- Copyright 2003-2010 by the contributors
35
-
36
- WordPress is released under the GPL
37
-
38
- ---
39
-
40
- ### GNU GENERAL PUBLIC LICENSE
41
-
42
- Version 2, June 1991
43
-
44
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
45
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
46
-
47
- Everyone is permitted to copy and distribute verbatim copies
48
- of this license document, but changing it is not allowed.
49
-
50
- ### Preamble
51
-
52
- The licenses for most software are designed to take away your freedom
53
- to share and change it. By contrast, the GNU General Public License is
54
- intended to guarantee your freedom to share and change free
55
- software--to make sure the software is free for all its users. This
56
- General Public License applies to most of the Free Software
57
- Foundation's software and to any other program whose authors commit to
58
- using it. (Some other Free Software Foundation software is covered by
59
- the GNU Lesser General Public License instead.) You can apply it to
60
- your programs, too.
61
-
62
- When we speak of free software, we are referring to freedom, not
63
- price. Our General Public Licenses are designed to make sure that you
64
- have the freedom to distribute copies of free software (and charge for
65
- this service if you wish), that you receive source code or can get it
66
- if you want it, that you can change the software or use pieces of it
67
- in new free programs; and that you know you can do these things.
68
-
69
- To protect your rights, we need to make restrictions that forbid
70
- anyone to deny you these rights or to ask you to surrender the rights.
71
- These restrictions translate to certain responsibilities for you if
72
- you distribute copies of the software, or if you modify it.
73
-
74
- For example, if you distribute copies of such a program, whether
75
- gratis or for a fee, you must give the recipients all the rights that
76
- you have. You must make sure that they, too, receive or can get the
77
- source code. And you must show them these terms so they know their
78
- rights.
79
-
80
- We protect your rights with two steps: (1) copyright the software, and
81
- (2) offer you this license which gives you legal permission to copy,
82
- distribute and/or modify the software.
83
-
84
- Also, for each author's protection and ours, we want to make certain
85
- that everyone understands that there is no warranty for this free
86
- software. If the software is modified by someone else and passed on,
87
- we want its recipients to know that what they have is not the
88
- original, so that any problems introduced by others will not reflect
89
- on the original authors' reputations.
90
-
91
- Finally, any free program is threatened constantly by software
92
- patents. We wish to avoid the danger that redistributors of a free
93
- program will individually obtain patent licenses, in effect making the
94
- program proprietary. To prevent this, we have made it clear that any
95
- patent must be licensed for everyone's free use or not licensed at
96
- all.
97
-
98
- The precise terms and conditions for copying, distribution and
99
- modification follow.
100
-
101
- ### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
102
-
103
- **0.** This License applies to any program or other work which
104
- contains a notice placed by the copyright holder saying it may be
105
- distributed under the terms of this General Public License. The
106
- "Program", below, refers to any such program or work, and a "work
107
- based on the Program" means either the Program or any derivative work
108
- under copyright law: that is to say, a work containing the Program or
109
- a portion of it, either verbatim or with modifications and/or
110
- translated into another language. (Hereinafter, translation is
111
- included without limitation in the term "modification".) Each licensee
112
- is addressed as "you".
113
-
114
- Activities other than copying, distribution and modification are not
115
- covered by this License; they are outside its scope. The act of
116
- running the Program is not restricted, and the output from the Program
117
- is covered only if its contents constitute a work based on the Program
118
- (independent of having been made by running the Program). Whether that
119
- is true depends on what the Program does.
120
-
121
- **1.** You may copy and distribute verbatim copies of the Program's
122
- source code as you receive it, in any medium, provided that you
123
- conspicuously and appropriately publish on each copy an appropriate
124
- copyright notice and disclaimer of warranty; keep intact all the
125
- notices that refer to this License and to the absence of any warranty;
126
- and give any other recipients of the Program a copy of this License
127
- along with the Program.
128
-
129
- You may charge a fee for the physical act of transferring a copy, and
130
- you may at your option offer warranty protection in exchange for a
131
- fee.
132
-
133
- **2.** You may modify your copy or copies of the Program or any
134
- portion of it, thus forming a work based on the Program, and copy and
135
- distribute such modifications or work under the terms of Section 1
136
- above, provided that you also meet all of these conditions:
137
-
138
-
139
- **a)** You must cause the modified files to carry prominent notices
140
- stating that you changed the files and the date of any change.
141
-
142
-
143
- **b)** You must cause any work that you distribute or publish, that in
144
- whole or in part contains or is derived from the Program or any part
145
- thereof, to be licensed as a whole at no charge to all third parties
146
- under the terms of this License.
147
-
148
-
149
- **c)** If the modified program normally reads commands interactively
150
- when run, you must cause it, when started running for such interactive
151
- use in the most ordinary way, to print or display an announcement
152
- including an appropriate copyright notice and a notice that there is
153
- no warranty (or else, saying that you provide a warranty) and that
154
- users may redistribute the program under these conditions, and telling
155
- the user how to view a copy of this License. (Exception: if the
156
- Program itself is interactive but does not normally print such an
157
- announcement, your work based on the Program is not required to print
158
- an announcement.)
159
-
160
- These requirements apply to the modified work as a whole. If
161
- identifiable sections of that work are not derived from the Program,
162
- and can be reasonably considered independent and separate works in
163
- themselves, then this License, and its terms, do not apply to those
164
- sections when you distribute them as separate works. But when you
165
- distribute the same sections as part of a whole which is a work based
166
- on the Program, the distribution of the whole must be on the terms of
167
- this License, whose permissions for other licensees extend to the
168
- entire whole, and thus to each and every part regardless of who wrote
169
- it.
170
-
171
- Thus, it is not the intent of this section to claim rights or contest
172
- your rights to work written entirely by you; rather, the intent is to
173
- exercise the right to control the distribution of derivative or
174
- collective works based on the Program.
175
-
176
- In addition, mere aggregation of another work not based on the Program
177
- with the Program (or with a work based on the Program) on a volume of
178
- a storage or distribution medium does not bring the other work under
179
- the scope of this License.
180
-
181
- **3.** You may copy and distribute the Program (or a work based on it,
182
- under Section 2) in object code or executable form under the terms of
183
- Sections 1 and 2 above provided that you also do one of the following:
184
-
185
-
186
- **a)** Accompany it with the complete corresponding machine-readable
187
- source code, which must be distributed under the terms of Sections 1
188
- and 2 above on a medium customarily used for software interchange; or,
189
-
190
-
191
- **b)** Accompany it with a written offer, valid for at least three
192
- years, to give any third party, for a charge no more than your cost of
193
- physically performing source distribution, a complete machine-readable
194
- copy of the corresponding source code, to be distributed under the
195
- terms of Sections 1 and 2 above on a medium customarily used for
196
- software interchange; or,
197
-
198
-
199
- **c)** Accompany it with the information you received as to the offer
200
- to distribute corresponding source code. (This alternative is allowed
201
- only for noncommercial distribution and only if you received the
202
- program in object code or executable form with such an offer, in
203
- accord with Subsection b above.)
204
-
205
- The source code for a work means the preferred form of the work for
206
- making modifications to it. For an executable work, complete source
207
- code means all the source code for all modules it contains, plus any
208
- associated interface definition files, plus the scripts used to
209
- control compilation and installation of the executable. However, as a
210
- special exception, the source code distributed need not include
211
- anything that is normally distributed (in either source or binary
212
- form) with the major components (compiler, kernel, and so on) of the
213
- operating system on which the executable runs, unless that component
214
- itself accompanies the executable.
215
-
216
- If distribution of executable or object code is made by offering
217
- access to copy from a designated place, then offering equivalent
218
- access to copy the source code from the same place counts as
219
- distribution of the source code, even though third parties are not
220
- compelled to copy the source along with the object code.
221
-
222
- **4.** You may not copy, modify, sublicense, or distribute the Program
223
- except as expressly provided under this License. Any attempt otherwise
224
- to copy, modify, sublicense or distribute the Program is void, and
225
- will automatically terminate your rights under this License. However,
226
- parties who have received copies, or rights, from you under this
227
- License will not have their licenses terminated so long as such
228
- parties remain in full compliance.
229
-
230
- **5.** You are not required to accept this License, since you have not
231
- signed it. However, nothing else grants you permission to modify or
232
- distribute the Program or its derivative works. These actions are
233
- prohibited by law if you do not accept this License. Therefore, by
234
- modifying or distributing the Program (or any work based on the
235
- Program), you indicate your acceptance of this License to do so, and
236
- all its terms and conditions for copying, distributing or modifying
237
- the Program or works based on it.
238
-
239
- **6.** Each time you redistribute the Program (or any work based on
240
- the Program), the recipient automatically receives a license from the
241
- original licensor to copy, distribute or modify the Program subject to
242
- these terms and conditions. You may not impose any further
243
- restrictions on the recipients' exercise of the rights granted herein.
244
- You are not responsible for enforcing compliance by third parties to
245
- this License.
246
-
247
- **7.** If, as a consequence of a court judgment or allegation of
248
- patent infringement or for any other reason (not limited to patent
249
- issues), conditions are imposed on you (whether by court order,
250
- agreement or otherwise) that contradict the conditions of this
251
- License, they do not excuse you from the conditions of this License.
252
- If you cannot distribute so as to satisfy simultaneously your
253
- obligations under this License and any other pertinent obligations,
254
- then as a consequence you may not distribute the Program at all. For
255
- example, if a patent license would not permit royalty-free
256
- redistribution of the Program by all those who receive copies directly
257
- or indirectly through you, then the only way you could satisfy both it
258
- and this License would be to refrain entirely from distribution of the
259
- Program.
260
-
261
- If any portion of this section is held invalid or unenforceable under
262
- any particular circumstance, the balance of the section is intended to
263
- apply and the section as a whole is intended to apply in other
264
- circumstances.
265
-
266
- It is not the purpose of this section to induce you to infringe any
267
- patents or other property right claims or to contest validity of any
268
- such claims; this section has the sole purpose of protecting the
269
- integrity of the free software distribution system, which is
270
- implemented by public license practices. Many people have made
271
- generous contributions to the wide range of software distributed
272
- through that system in reliance on consistent application of that
273
- system; it is up to the author/donor to decide if he or she is willing
274
- to distribute software through any other system and a licensee cannot
275
- impose that choice.
276
-
277
- This section is intended to make thoroughly clear what is believed to
278
- be a consequence of the rest of this License.
279
-
280
- **8.** If the distribution and/or use of the Program is restricted in
281
- certain countries either by patents or by copyrighted interfaces, the
282
- original copyright holder who places the Program under this License
283
- may add an explicit geographical distribution limitation excluding
284
- those countries, so that distribution is permitted only in or among
285
- countries not thus excluded. In such case, this License incorporates
286
- the limitation as if written in the body of this License.
287
-
288
- **9.** The Free Software Foundation may publish revised and/or new
289
- versions of the General Public License from time to time. Such new
290
- versions will be similar in spirit to the present version, but may
291
- differ in detail to address new problems or concerns.
292
-
293
- Each version is given a distinguishing version number. If the Program
294
- specifies a version number of this License which applies to it and
295
- "any later version", you have the option of following the terms and
296
- conditions either of that version or of any later version published by
297
- the Free Software Foundation. If the Program does not specify a
298
- version number of this License, you may choose any version ever
299
- published by the Free Software Foundation.
300
-
301
- **10.** If you wish to incorporate parts of the Program into other
302
- free programs whose distribution conditions are different, write to
303
- the author to ask for permission. For software which is copyrighted by
304
- the Free Software Foundation, write to the Free Software Foundation;
305
- we sometimes make exceptions for this. Our decision will be guided by
306
- the two goals of preserving the free status of all derivatives of our
307
- free software and of promoting the sharing and reuse of software
308
- generally.
309
-
310
- **NO WARRANTY**
311
-
312
- **11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
313
- WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
314
- EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
315
- OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY
316
- KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
317
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
318
- PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
319
- PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
320
- THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
321
-
322
- **12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
323
- WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
324
- AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
325
- FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
326
- CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
327
- PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
328
- RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
329
- FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
330
- SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
331
- DAMAGES.
332
-
333
- ### END OF TERMS AND CONDITIONS
334
-
335
- ### How to Apply These Terms to Your New Programs
336
-
337
- If you develop a new program, and you want it to be of the greatest
338
- possible use to the public, the best way to achieve this is to make it
339
- free software which everyone can redistribute and change under these
340
- terms.
341
-
342
- To do so, attach the following notices to the program. It is safest to
343
- attach them to the start of each source file to most effectively
344
- convey the exclusion of warranty; and each file should have at least
345
- the "copyright" line and a pointer to where the full notice is found.
346
-
347
- one line to give the program's name and an idea of what it does.
348
- Copyright (C) yyyy name of author
349
-
350
- This program is free software; you can redistribute it and/or
351
- modify it under the terms of the GNU General Public License
352
- as published by the Free Software Foundation; either version 2
353
- of the License, or (at your option) any later version.
354
-
355
- This program is distributed in the hope that it will be useful,
356
- but WITHOUT ANY WARRANTY; without even the implied warranty of
357
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
358
- GNU General Public License for more details.
359
-
360
- You should have received a copy of the GNU General Public License
361
- along with this program; if not, write to the Free Software
362
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
363
-
364
- Also add information on how to contact you by electronic and paper
365
- mail.
366
-
367
- If the program is interactive, make it output a short notice like this
368
- when it starts in an interactive mode:
369
-
370
- Gnomovision version 69, Copyright (C) year name of author
371
- Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
372
- type `show w'. This is free software, and you are welcome
373
- to redistribute it under certain conditions; type `show c'
374
- for details.
375
-
376
- The hypothetical commands \`show w' and \`show c' should show the
377
- appropriate parts of the General Public License. Of course, the
378
- commands you use may be called something other than \`show w' and
379
- \`show c'; they could even be mouse-clicks or menu items--whatever
380
- suits your program.
381
-
382
- You should also get your employer (if you work as a programmer) or
383
- your school, if any, to sign a "copyright disclaimer" for the program,
384
- if necessary. Here is a sample; alter the names:
385
-
386
- Yoyodyne, Inc., hereby disclaims all copyright
387
- interest in the program `Gnomovision'
388
- (which makes passes at compilers) written
389
- by James Hacker.
390
-
391
- signature of Ty Coon, 1 April 1989
392
- Ty Coon, President of Vice
393
-
394
- This General Public License does not permit incorporating your program
395
- into proprietary programs. If your program is a subroutine library,
396
- you may consider it more useful to permit linking proprietary
397
- applications with the library. If this is what you want to do, use the
398
- [GNU Lesser General Public
399
- License](http://www.gnu.org/licenses/lgpl.html) instead of this
400
- License.
1
+ ### WordPress - Web publishing software
2
+
3
+ Copyright 2011-2019 by the contributors
4
+
5
+ This program is free software; you can redistribute it and/or modify
6
+ it under the terms of the GNU General Public License as published by
7
+ the Free Software Foundation; either version 2 of the License, or
8
+ (at your option) any later version.
9
+
10
+ This program is distributed in the hope that it will be useful,
11
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ GNU General Public License for more details.
14
+
15
+ You should have received a copy of the GNU General Public License
16
+ along with this program; if not, write to the Free Software
17
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
+
19
+ This program incorporates work covered by the following copyright and
20
+ permission notices:
21
+
22
+ b2 is (c) 2001, 2002 Michel Valdrighi - m@tidakada.com -
23
+ http://tidakada.com
24
+
25
+ Wherever third party code has been used, credit has been given in the code's
26
+ comments.
27
+
28
+ b2 is released under the GPL
29
+
30
+ and
31
+
32
+ WordPress - Web publishing software
33
+
34
+ Copyright 2003-2010 by the contributors
35
+
36
+ WordPress is released under the GPL
37
+
38
+ ---
39
+
40
+ ### GNU GENERAL PUBLIC LICENSE
41
+
42
+ Version 2, June 1991
43
+
44
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
45
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
46
+
47
+ Everyone is permitted to copy and distribute verbatim copies
48
+ of this license document, but changing it is not allowed.
49
+
50
+ ### Preamble
51
+
52
+ The licenses for most software are designed to take away your freedom
53
+ to share and change it. By contrast, the GNU General Public License is
54
+ intended to guarantee your freedom to share and change free
55
+ software--to make sure the software is free for all its users. This
56
+ General Public License applies to most of the Free Software
57
+ Foundation's software and to any other program whose authors commit to
58
+ using it. (Some other Free Software Foundation software is covered by
59
+ the GNU Lesser General Public License instead.) You can apply it to
60
+ your programs, too.
61
+
62
+ When we speak of free software, we are referring to freedom, not
63
+ price. Our General Public Licenses are designed to make sure that you
64
+ have the freedom to distribute copies of free software (and charge for
65
+ this service if you wish), that you receive source code or can get it
66
+ if you want it, that you can change the software or use pieces of it
67
+ in new free programs; and that you know you can do these things.
68
+
69
+ To protect your rights, we need to make restrictions that forbid
70
+ anyone to deny you these rights or to ask you to surrender the rights.
71
+ These restrictions translate to certain responsibilities for you if
72
+ you distribute copies of the software, or if you modify it.
73
+
74
+ For example, if you distribute copies of such a program, whether
75
+ gratis or for a fee, you must give the recipients all the rights that
76
+ you have. You must make sure that they, too, receive or can get the
77
+ source code. And you must show them these terms so they know their
78
+ rights.
79
+
80
+ We protect your rights with two steps: (1) copyright the software, and
81
+ (2) offer you this license which gives you legal permission to copy,
82
+ distribute and/or modify the software.
83
+
84
+ Also, for each author's protection and ours, we want to make certain
85
+ that everyone understands that there is no warranty for this free
86
+ software. If the software is modified by someone else and passed on,
87
+ we want its recipients to know that what they have is not the
88
+ original, so that any problems introduced by others will not reflect
89
+ on the original authors' reputations.
90
+
91
+ Finally, any free program is threatened constantly by software
92
+ patents. We wish to avoid the danger that redistributors of a free
93
+ program will individually obtain patent licenses, in effect making the
94
+ program proprietary. To prevent this, we have made it clear that any
95
+ patent must be licensed for everyone's free use or not licensed at
96
+ all.
97
+
98
+ The precise terms and conditions for copying, distribution and
99
+ modification follow.
100
+
101
+ ### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
102
+
103
+ **0.** This License applies to any program or other work which
104
+ contains a notice placed by the copyright holder saying it may be
105
+ distributed under the terms of this General Public License. The
106
+ "Program", below, refers to any such program or work, and a "work
107
+ based on the Program" means either the Program or any derivative work
108
+ under copyright law: that is to say, a work containing the Program or
109
+ a portion of it, either verbatim or with modifications and/or
110
+ translated into another language. (Hereinafter, translation is
111
+ included without limitation in the term "modification".) Each licensee
112
+ is addressed as "you".
113
+
114
+ Activities other than copying, distribution and modification are not
115
+ covered by this License; they are outside its scope. The act of
116
+ running the Program is not restricted, and the output from the Program
117
+ is covered only if its contents constitute a work based on the Program
118
+ (independent of having been made by running the Program). Whether that
119
+ is true depends on what the Program does.
120
+
121
+ **1.** You may copy and distribute verbatim copies of the Program's
122
+ source code as you receive it, in any medium, provided that you
123
+ conspicuously and appropriately publish on each copy an appropriate
124
+ copyright notice and disclaimer of warranty; keep intact all the
125
+ notices that refer to this License and to the absence of any warranty;
126
+ and give any other recipients of the Program a copy of this License
127
+ along with the Program.
128
+
129
+ You may charge a fee for the physical act of transferring a copy, and
130
+ you may at your option offer warranty protection in exchange for a
131
+ fee.
132
+
133
+ **2.** You may modify your copy or copies of the Program or any
134
+ portion of it, thus forming a work based on the Program, and copy and
135
+ distribute such modifications or work under the terms of Section 1
136
+ above, provided that you also meet all of these conditions:
137
+
138
+
139
+ **a)** You must cause the modified files to carry prominent notices
140
+ stating that you changed the files and the date of any change.
141
+
142
+
143
+ **b)** You must cause any work that you distribute or publish, that in
144
+ whole or in part contains or is derived from the Program or any part
145
+ thereof, to be licensed as a whole at no charge to all third parties
146
+ under the terms of this License.
147
+
148
+
149
+ **c)** If the modified program normally reads commands interactively
150
+ when run, you must cause it, when started running for such interactive
151
+ use in the most ordinary way, to print or display an announcement
152
+ including an appropriate copyright notice and a notice that there is
153
+ no warranty (or else, saying that you provide a warranty) and that
154
+ users may redistribute the program under these conditions, and telling
155
+ the user how to view a copy of this License. (Exception: if the
156
+ Program itself is interactive but does not normally print such an
157
+ announcement, your work based on the Program is not required to print
158
+ an announcement.)
159
+
160
+ These requirements apply to the modified work as a whole. If
161
+ identifiable sections of that work are not derived from the Program,
162
+ and can be reasonably considered independent and separate works in
163
+ themselves, then this License, and its terms, do not apply to those
164
+ sections when you distribute them as separate works. But when you
165
+ distribute the same sections as part of a whole which is a work based
166
+ on the Program, the distribution of the whole must be on the terms of
167
+ this License, whose permissions for other licensees extend to the
168
+ entire whole, and thus to each and every part regardless of who wrote
169
+ it.
170
+
171
+ Thus, it is not the intent of this section to claim rights or contest
172
+ your rights to work written entirely by you; rather, the intent is to
173
+ exercise the right to control the distribution of derivative or
174
+ collective works based on the Program.
175
+
176
+ In addition, mere aggregation of another work not based on the Program
177
+ with the Program (or with a work based on the Program) on a volume of
178
+ a storage or distribution medium does not bring the other work under
179
+ the scope of this License.
180
+
181
+ **3.** You may copy and distribute the Program (or a work based on it,
182
+ under Section 2) in object code or executable form under the terms of
183
+ Sections 1 and 2 above provided that you also do one of the following:
184
+
185
+
186
+ **a)** Accompany it with the complete corresponding machine-readable
187
+ source code, which must be distributed under the terms of Sections 1
188
+ and 2 above on a medium customarily used for software interchange; or,
189
+
190
+
191
+ **b)** Accompany it with a written offer, valid for at least three
192
+ years, to give any third party, for a charge no more than your cost of
193
+ physically performing source distribution, a complete machine-readable
194
+ copy of the corresponding source code, to be distributed under the
195
+ terms of Sections 1 and 2 above on a medium customarily used for
196
+ software interchange; or,
197
+
198
+
199
+ **c)** Accompany it with the information you received as to the offer
200
+ to distribute corresponding source code. (This alternative is allowed
201
+ only for noncommercial distribution and only if you received the
202
+ program in object code or executable form with such an offer, in
203
+ accord with Subsection b above.)
204
+
205
+ The source code for a work means the preferred form of the work for
206
+ making modifications to it. For an executable work, complete source
207
+ code means all the source code for all modules it contains, plus any
208
+ associated interface definition files, plus the scripts used to
209
+ control compilation and installation of the executable. However, as a
210
+ special exception, the source code distributed need not include
211
+ anything that is normally distributed (in either source or binary
212
+ form) with the major components (compiler, kernel, and so on) of the
213
+ operating system on which the executable runs, unless that component
214
+ itself accompanies the executable.
215
+
216
+ If distribution of executable or object code is made by offering
217
+ access to copy from a designated place, then offering equivalent
218
+ access to copy the source code from the same place counts as
219
+ distribution of the source code, even though third parties are not
220
+ compelled to copy the source along with the object code.
221
+
222
+ **4.** You may not copy, modify, sublicense, or distribute the Program
223
+ except as expressly provided under this License. Any attempt otherwise
224
+ to copy, modify, sublicense or distribute the Program is void, and
225
+ will automatically terminate your rights under this License. However,
226
+ parties who have received copies, or rights, from you under this
227
+ License will not have their licenses terminated so long as such
228
+ parties remain in full compliance.
229
+
230
+ **5.** You are not required to accept this License, since you have not
231
+ signed it. However, nothing else grants you permission to modify or
232
+ distribute the Program or its derivative works. These actions are
233
+ prohibited by law if you do not accept this License. Therefore, by
234
+ modifying or distributing the Program (or any work based on the
235
+ Program), you indicate your acceptance of this License to do so, and
236
+ all its terms and conditions for copying, distributing or modifying
237
+ the Program or works based on it.
238
+
239
+ **6.** Each time you redistribute the Program (or any work based on
240
+ the Program), the recipient automatically receives a license from the
241
+ original licensor to copy, distribute or modify the Program subject to
242
+ these terms and conditions. You may not impose any further
243
+ restrictions on the recipients' exercise of the rights granted herein.
244
+ You are not responsible for enforcing compliance by third parties to
245
+ this License.
246
+
247
+ **7.** If, as a consequence of a court judgment or allegation of
248
+ patent infringement or for any other reason (not limited to patent
249
+ issues), conditions are imposed on you (whether by court order,
250
+ agreement or otherwise) that contradict the conditions of this
251
+ License, they do not excuse you from the conditions of this License.
252
+ If you cannot distribute so as to satisfy simultaneously your
253
+ obligations under this License and any other pertinent obligations,
254
+ then as a consequence you may not distribute the Program at all. For
255
+ example, if a patent license would not permit royalty-free
256
+ redistribution of the Program by all those who receive copies directly
257
+ or indirectly through you, then the only way you could satisfy both it
258
+ and this License would be to refrain entirely from distribution of the
259
+ Program.
260
+
261
+ If any portion of this section is held invalid or unenforceable under
262
+ any particular circumstance, the balance of the section is intended to
263
+ apply and the section as a whole is intended to apply in other
264
+ circumstances.
265
+
266
+ It is not the purpose of this section to induce you to infringe any
267
+ patents or other property right claims or to contest validity of any
268
+ such claims; this section has the sole purpose of protecting the
269
+ integrity of the free software distribution system, which is
270
+ implemented by public license practices. Many people have made
271
+ generous contributions to the wide range of software distributed
272
+ through that system in reliance on consistent application of that
273
+ system; it is up to the author/donor to decide if he or she is willing
274
+ to distribute software through any other system and a licensee cannot
275
+ impose that choice.
276
+
277
+ This section is intended to make thoroughly clear what is believed to
278
+ be a consequence of the rest of this License.
279
+
280
+ **8.** If the distribution and/or use of the Program is restricted in
281
+ certain countries either by patents or by copyrighted interfaces, the
282
+ original copyright holder who places the Program under this License
283
+ may add an explicit geographical distribution limitation excluding
284
+ those countries, so that distribution is permitted only in or among
285
+ countries not thus excluded. In such case, this License incorporates
286
+ the limitation as if written in the body of this License.
287
+
288
+ **9.** The Free Software Foundation may publish revised and/or new
289
+ versions of the General Public License from time to time. Such new
290
+ versions will be similar in spirit to the present version, but may
291
+ differ in detail to address new problems or concerns.
292
+
293
+ Each version is given a distinguishing version number. If the Program
294
+ specifies a version number of this License which applies to it and
295
+ "any later version", you have the option of following the terms and
296
+ conditions either of that version or of any later version published by
297
+ the Free Software Foundation. If the Program does not specify a
298
+ version number of this License, you may choose any version ever
299
+ published by the Free Software Foundation.
300
+
301
+ **10.** If you wish to incorporate parts of the Program into other
302
+ free programs whose distribution conditions are different, write to
303
+ the author to ask for permission. For software which is copyrighted by
304
+ the Free Software Foundation, write to the Free Software Foundation;
305
+ we sometimes make exceptions for this. Our decision will be guided by
306
+ the two goals of preserving the free status of all derivatives of our
307
+ free software and of promoting the sharing and reuse of software
308
+ generally.
309
+
310
+ **NO WARRANTY**
311
+
312
+ **11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO
313
+ WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
314
+ EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
315
+ OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY
316
+ KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
317
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
318
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
319
+ PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
320
+ THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
321
+
322
+ **12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
323
+ WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
324
+ AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU
325
+ FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
326
+ CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
327
+ PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
328
+ RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
329
+ FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF
330
+ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
331
+ DAMAGES.
332
+
333
+ ### END OF TERMS AND CONDITIONS
334
+
335
+ ### How to Apply These Terms to Your New Programs
336
+
337
+ If you develop a new program, and you want it to be of the greatest
338
+ possible use to the public, the best way to achieve this is to make it
339
+ free software which everyone can redistribute and change under these
340
+ terms.
341
+
342
+ To do so, attach the following notices to the program. It is safest to
343
+ attach them to the start of each source file to most effectively
344
+ convey the exclusion of warranty; and each file should have at least
345
+ the "copyright" line and a pointer to where the full notice is found.
346
+
347
+ one line to give the program's name and an idea of what it does.
348
+ Copyright (C) yyyy name of author
349
+
350
+ This program is free software; you can redistribute it and/or
351
+ modify it under the terms of the GNU General Public License
352
+ as published by the Free Software Foundation; either version 2
353
+ of the License, or (at your option) any later version.
354
+
355
+ This program is distributed in the hope that it will be useful,
356
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
357
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
358
+ GNU General Public License for more details.
359
+
360
+ You should have received a copy of the GNU General Public License
361
+ along with this program; if not, write to the Free Software
362
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
363
+
364
+ Also add information on how to contact you by electronic and paper
365
+ mail.
366
+
367
+ If the program is interactive, make it output a short notice like this
368
+ when it starts in an interactive mode:
369
+
370
+ Gnomovision version 69, Copyright (C) year name of author
371
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details
372
+ type `show w'. This is free software, and you are welcome
373
+ to redistribute it under certain conditions; type `show c'
374
+ for details.
375
+
376
+ The hypothetical commands \`show w' and \`show c' should show the
377
+ appropriate parts of the General Public License. Of course, the
378
+ commands you use may be called something other than \`show w' and
379
+ \`show c'; they could even be mouse-clicks or menu items--whatever
380
+ suits your program.
381
+
382
+ You should also get your employer (if you work as a programmer) or
383
+ your school, if any, to sign a "copyright disclaimer" for the program,
384
+ if necessary. Here is a sample; alter the names:
385
+
386
+ Yoyodyne, Inc., hereby disclaims all copyright
387
+ interest in the program `Gnomovision'
388
+ (which makes passes at compilers) written
389
+ by James Hacker.
390
+
391
+ signature of Ty Coon, 1 April 1989
392
+ Ty Coon, President of Vice
393
+
394
+ This General Public License does not permit incorporating your program
395
+ into proprietary programs. If your program is a subroutine library,
396
+ you may consider it more useful to permit linking proprietary
397
+ applications with the library. If this is what you want to do, use the
398
+ [GNU Lesser General Public
399
+ License](http://www.gnu.org/licenses/lgpl.html) instead of this
400
+ License.
classic-editor.php CHANGED
@@ -5,13 +5,15 @@
5
  * Plugin Name: Classic Editor
6
  * Plugin URI: https://wordpress.org/plugins/classic-editor/
7
  * Description: Enables the WordPress classic editor and the old-style Edit Post screen with TinyMCE, Meta Boxes, etc. Supports the older plugins that extend this screen.
8
- * Version: 1.5
9
  * Author: WordPress Contributors
10
  * Author URI: https://github.com/WordPress/classic-editor/
11
  * License: GPLv2 or later
12
  * License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
13
  * Text Domain: classic-editor
14
  * Domain Path: /languages
 
 
15
  *
16
  * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
17
  * General Public License version 2, as published by the Free Software Foundation. You may NOT assume
@@ -37,7 +39,6 @@ class Classic_Editor {
37
  $gutenberg = function_exists( 'gutenberg_register_scripts_and_styles' );
38
 
39
  register_activation_hook( __FILE__, array( __CLASS__, 'activate' ) );
40
- register_uninstall_hook( __FILE__, array( __CLASS__, 'uninstall' ) );
41
 
42
  $settings = self::get_settings();
43
 
@@ -290,7 +291,7 @@ class Classic_Editor {
290
  $which = get_post_meta( $post_id, 'classic-editor-remember', true );
291
 
292
  if ( $which ) {
293
- // The editor choice will be "remembered" when the post is opened in either Classic or Block editor.
294
  if ( 'classic-editor' === $which ) {
295
  return true;
296
  } elseif ( 'block-editor' === $which ) {
@@ -336,9 +337,18 @@ class Classic_Editor {
336
  'sanitize_callback' => array( __CLASS__, 'validate_option_allow_users' ),
337
  ) );
338
 
339
- add_option_whitelist( array(
340
- 'writing' => array( 'classic-editor-replace', 'classic-editor-allow-users' ),
341
- ) );
 
 
 
 
 
 
 
 
 
342
 
343
  $heading_1 = __( 'Default editor for all users', 'classic-editor' );
344
  $heading_2 = __( 'Allow users to switch editors', 'classic-editor' );
@@ -390,11 +400,11 @@ class Classic_Editor {
390
  <div class="classic-editor-options">
391
  <p>
392
  <input type="radio" name="classic-editor-replace" id="classic-editor-classic" value="classic"<?php if ( $settings['editor'] === 'classic' ) echo ' checked'; ?> />
393
- <label for="classic-editor-classic"><?php _ex( 'Classic Editor', 'Editor Name', 'classic-editor' ); ?></label>
394
  </p>
395
  <p>
396
  <input type="radio" name="classic-editor-replace" id="classic-editor-block" value="block"<?php if ( $settings['editor'] !== 'classic' ) echo ' checked'; ?> />
397
- <label for="classic-editor-block"><?php _ex( 'Block Editor', 'Editor Name', 'classic-editor' ); ?></label>
398
  </p>
399
  </div>
400
  <script>
@@ -467,11 +477,11 @@ class Classic_Editor {
467
  <td>
468
  <p>
469
  <input type="radio" name="classic-editor-replace" id="classic-editor-classic" value="classic"<?php if ( $editor !== 'block' ) echo ' checked'; ?> />
470
- <label for="classic-editor-classic"><?php _ex( 'Classic Editor', 'Editor Name', 'classic-editor' ); ?></label>
471
  </p>
472
  <p>
473
  <input type="radio" name="classic-editor-replace" id="classic-editor-block" value="block"<?php if ( $editor === 'block' ) echo ' checked'; ?> />
474
- <label for="classic-editor-block"><?php _ex( 'Block Editor', 'Editor Name', 'classic-editor' ); ?></label>
475
  </p>
476
  </td>
477
  </tr>
@@ -480,7 +490,7 @@ class Classic_Editor {
480
  <td>
481
  <input type="checkbox" name="classic-editor-allow-sites" id="classic-editor-allow-sites" value="allow"<?php if ( $is_checked ) echo ' checked'; ?>>
482
  <label for="classic-editor-allow-sites"><?php _e( 'Allow site admins to change settings', 'classic-editor' ); ?></label>
483
- <p class="description"><?php _e( 'By default the Block Editor is replaced with the Classic Editor and users cannot switch editors.', 'classic-editor' ); ?></p>
484
  </td>
485
  </tr>
486
  </table>
@@ -508,7 +518,7 @@ class Classic_Editor {
508
 
509
  /**
510
  * Add a hidden field in edit-form-advanced.php
511
- * to help redirect back to the Classic Editor on saving.
512
  */
513
  public static function add_redirect_helper() {
514
  ?>
@@ -517,7 +527,7 @@ class Classic_Editor {
517
  }
518
 
519
  /**
520
- * Remember when the Classic Editor was used to edit a post.
521
  */
522
  public static function remember_classic_editor( $post ) {
523
  $post_type = get_post_type( $post );
@@ -528,7 +538,7 @@ class Classic_Editor {
528
  }
529
 
530
  /**
531
- * Remember when the Block Editor was used to edit a post.
532
  */
533
  public static function remember_block_editor( $editor_settings, $post ) {
534
  $post_type = get_post_type( $post );
@@ -549,13 +559,13 @@ class Classic_Editor {
549
  /**
550
  * Choose which editor to use for a post.
551
  *
552
- * Passes through `$which_editor` for Block Editor (it's sets to `true` but may be changed by another plugin).
553
  *
554
  * @uses `use_block_editor_for_post` filter.
555
  *
556
- * @param boolean $use_block_editor True for Block Editor, false for Classic Editor.
557
  * @param WP_Post $post The post being edited.
558
- * @return boolean True for Block Editor, false for Classic Editor.
559
  */
560
  public static function choose_editor( $use_block_editor, $post ) {
561
  $settings = self::get_settings();
@@ -571,7 +581,7 @@ class Classic_Editor {
571
  if ( empty( $post->ID ) || $post->post_status === 'auto-draft' ) {
572
  if (
573
  ( $settings['editor'] === 'classic' && ! isset( $_GET['classic-editor__forget'] ) ) || // Add New
574
- ( isset( $_GET['classic-editor'] ) && isset( $_GET['classic-editor__forget'] ) ) // Switch to Classic Editor when no draft post.
575
  ) {
576
  $use_block_editor = false;
577
  }
@@ -637,14 +647,14 @@ class Classic_Editor {
637
  public static function do_meta_box( $post ) {
638
  $edit_url = get_edit_post_link( $post->ID, 'raw' );
639
 
640
- // Switching to Block Editor.
641
  $edit_url = remove_query_arg( 'classic-editor', $edit_url );
642
  // Forget the previous value when going to a specific editor.
643
  $edit_url = add_query_arg( 'classic-editor__forget', '', $edit_url );
644
 
645
  ?>
646
  <p style="margin: 1em 0;">
647
- <a href="<?php echo esc_url( $edit_url ); ?>"><?php _e( 'Switch to Block Editor', 'classic-editor' ); ?></a>
648
  </p>
649
  <?php
650
  }
@@ -668,7 +678,7 @@ class Classic_Editor {
668
  wp_localize_script(
669
  'classic-editor-plugin',
670
  'classicEditorPluginL10n',
671
- array( 'linkText' => __( 'Switch to Classic Editor', 'classic-editor' ) )
672
  );
673
  }
674
 
@@ -765,7 +775,7 @@ class Classic_Editor {
765
 
766
  /**
767
  * Adds links to the post/page screens to edit any post or page in
768
- * the Classic Editor or Block Editor.
769
  *
770
  * @param array $actions Post actions.
771
  * @param WP_Post $post Edited post.
@@ -800,18 +810,18 @@ class Classic_Editor {
800
  // Build the edit actions. See also: WP_Posts_List_Table::handle_row_actions().
801
  $title = _draft_or_post_title( $post->ID );
802
 
803
- // Link to the Block Editor.
804
  $url = remove_query_arg( 'classic-editor', $edit_url );
805
- $text = _x( 'Edit (Block Editor)', 'Editor Name', 'classic-editor' );
806
  /* translators: %s: post title */
807
- $label = sprintf( __( 'Edit &#8220;%s&#8221; in the Block Editor', 'classic-editor' ), $title );
808
  $edit_block = sprintf( '<a href="%s" aria-label="%s">%s</a>', esc_url( $url ), esc_attr( $label ), $text );
809
 
810
- // Link to the Classic Editor.
811
  $url = add_query_arg( 'classic-editor', '', $edit_url );
812
- $text = _x( 'Edit (Classic Editor)', 'Editor Name', 'classic-editor' );
813
  /* translators: %s: post title */
814
- $label = sprintf( __( 'Edit &#8220;%s&#8221; in the Classic Editor', 'classic-editor' ), $title );
815
  $edit_classic = sprintf( '<a href="%s" aria-label="%s">%s</a>', esc_url( $url ), esc_attr( $label ), $text );
816
 
817
  $edit_actions = array(
@@ -839,11 +849,11 @@ class Classic_Editor {
839
  if ( ! $editors['classic_editor'] && ! $editors['block_editor'] ) {
840
  return $post_states;
841
  } elseif ( $editors['classic_editor'] && ! $editors['block_editor'] ) {
842
- // Forced to Classic Editor.
843
- $state = '<span class="classic-editor-forced-state">' . _x( 'Classic Editor', 'Editor Name', 'classic-editor' ) . '</span>';
844
  } elseif ( ! $editors['classic_editor'] && $editors['block_editor'] ) {
845
- // Forced to Block Editor.
846
- $state = '<span class="classic-editor-forced-state">' . _x( 'Block Editor', 'Editor Name', 'classic-editor' ) . '</span>';
847
  } else {
848
  $last_editor = get_post_meta( $post->ID, 'classic-editor-remember', true );
849
 
@@ -856,7 +866,7 @@ class Classic_Editor {
856
  $is_classic = ( $settings['editor'] === 'classic' );
857
  }
858
 
859
- $state = $is_classic ? _x( 'Classic Editor', 'Editor Name', 'classic-editor' ) : _x( 'Block Editor', 'Editor Name', 'classic-editor' );
860
  }
861
 
862
  // Fix PHP 7+ warnings if another plugin returns unexpected type.
@@ -913,6 +923,8 @@ class Classic_Editor {
913
  * Set defaults on activation.
914
  */
915
  public static function activate() {
 
 
916
  if ( is_multisite() ) {
917
  add_network_option( null, 'classic-editor-replace', 'classic' );
918
  add_network_option( null, 'classic-editor-allow-sites', 'disallow' );
5
  * Plugin Name: Classic Editor
6
  * Plugin URI: https://wordpress.org/plugins/classic-editor/
7
  * Description: Enables the WordPress classic editor and the old-style Edit Post screen with TinyMCE, Meta Boxes, etc. Supports the older plugins that extend this screen.
8
+ * Version: 1.6
9
  * Author: WordPress Contributors
10
  * Author URI: https://github.com/WordPress/classic-editor/
11
  * License: GPLv2 or later
12
  * License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
13
  * Text Domain: classic-editor
14
  * Domain Path: /languages
15
+ * Requires at least: 4.9
16
+ * Requires PHP: 5.2.4
17
  *
18
  * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
19
  * General Public License version 2, as published by the Free Software Foundation. You may NOT assume
39
  $gutenberg = function_exists( 'gutenberg_register_scripts_and_styles' );
40
 
41
  register_activation_hook( __FILE__, array( __CLASS__, 'activate' ) );
 
42
 
43
  $settings = self::get_settings();
44
 
291
  $which = get_post_meta( $post_id, 'classic-editor-remember', true );
292
 
293
  if ( $which ) {
294
+ // The editor choice will be "remembered" when the post is opened in either the classic or the block editor.
295
  if ( 'classic-editor' === $which ) {
296
  return true;
297
  } elseif ( 'block-editor' === $which ) {
337
  'sanitize_callback' => array( __CLASS__, 'validate_option_allow_users' ),
338
  ) );
339
 
340
+ $allowed_options = array(
341
+ 'writing' => array(
342
+ 'classic-editor-replace',
343
+ 'classic-editor-allow-users'
344
+ ),
345
+ );
346
+
347
+ if ( function_exists( 'add_allowed_options' ) ) {
348
+ add_allowed_options( $allowed_options );
349
+ } else {
350
+ add_option_whitelist( $allowed_options );
351
+ }
352
 
353
  $heading_1 = __( 'Default editor for all users', 'classic-editor' );
354
  $heading_2 = __( 'Allow users to switch editors', 'classic-editor' );
400
  <div class="classic-editor-options">
401
  <p>
402
  <input type="radio" name="classic-editor-replace" id="classic-editor-classic" value="classic"<?php if ( $settings['editor'] === 'classic' ) echo ' checked'; ?> />
403
+ <label for="classic-editor-classic"><?php _ex( 'Classic editor', 'Editor Name', 'classic-editor' ); ?></label>
404
  </p>
405
  <p>
406
  <input type="radio" name="classic-editor-replace" id="classic-editor-block" value="block"<?php if ( $settings['editor'] !== 'classic' ) echo ' checked'; ?> />
407
+ <label for="classic-editor-block"><?php _ex( 'Block editor', 'Editor Name', 'classic-editor' ); ?></label>
408
  </p>
409
  </div>
410
  <script>
477
  <td>
478
  <p>
479
  <input type="radio" name="classic-editor-replace" id="classic-editor-classic" value="classic"<?php if ( $editor !== 'block' ) echo ' checked'; ?> />
480
+ <label for="classic-editor-classic"><?php _ex( 'Classic editor', 'Editor Name', 'classic-editor' ); ?></label>
481
  </p>
482
  <p>
483
  <input type="radio" name="classic-editor-replace" id="classic-editor-block" value="block"<?php if ( $editor === 'block' ) echo ' checked'; ?> />
484
+ <label for="classic-editor-block"><?php _ex( 'Block editor', 'Editor Name', 'classic-editor' ); ?></label>
485
  </p>
486
  </td>
487
  </tr>
490
  <td>
491
  <input type="checkbox" name="classic-editor-allow-sites" id="classic-editor-allow-sites" value="allow"<?php if ( $is_checked ) echo ' checked'; ?>>
492
  <label for="classic-editor-allow-sites"><?php _e( 'Allow site admins to change settings', 'classic-editor' ); ?></label>
493
+ <p class="description"><?php _e( 'By default the block editor is replaced with the classic editor and users cannot switch editors.', 'classic-editor' ); ?></p>
494
  </td>
495
  </tr>
496
  </table>
518
 
519
  /**
520
  * Add a hidden field in edit-form-advanced.php
521
+ * to help redirect back to the classic editor on saving.
522
  */
523
  public static function add_redirect_helper() {
524
  ?>
527
  }
528
 
529
  /**
530
+ * Remember when the classic editor was used to edit a post.
531
  */
532
  public static function remember_classic_editor( $post ) {
533
  $post_type = get_post_type( $post );
538
  }
539
 
540
  /**
541
+ * Remember when the block editor was used to edit a post.
542
  */
543
  public static function remember_block_editor( $editor_settings, $post ) {
544
  $post_type = get_post_type( $post );
559
  /**
560
  * Choose which editor to use for a post.
561
  *
562
+ * Passes through `$which_editor` for block editor (it's sets to `true` but may be changed by another plugin).
563
  *
564
  * @uses `use_block_editor_for_post` filter.
565
  *
566
+ * @param boolean $use_block_editor True for block editor, false for classic editor.
567
  * @param WP_Post $post The post being edited.
568
+ * @return boolean True for block editor, false for classic editor.
569
  */
570
  public static function choose_editor( $use_block_editor, $post ) {
571
  $settings = self::get_settings();
581
  if ( empty( $post->ID ) || $post->post_status === 'auto-draft' ) {
582
  if (
583
  ( $settings['editor'] === 'classic' && ! isset( $_GET['classic-editor__forget'] ) ) || // Add New
584
+ ( isset( $_GET['classic-editor'] ) && isset( $_GET['classic-editor__forget'] ) ) // Switch to classic editor when no draft post.
585
  ) {
586
  $use_block_editor = false;
587
  }
647
  public static function do_meta_box( $post ) {
648
  $edit_url = get_edit_post_link( $post->ID, 'raw' );
649
 
650
+ // Switching to block editor.
651
  $edit_url = remove_query_arg( 'classic-editor', $edit_url );
652
  // Forget the previous value when going to a specific editor.
653
  $edit_url = add_query_arg( 'classic-editor__forget', '', $edit_url );
654
 
655
  ?>
656
  <p style="margin: 1em 0;">
657
+ <a href="<?php echo esc_url( $edit_url ); ?>"><?php _e( 'Switch to block editor', 'classic-editor' ); ?></a>
658
  </p>
659
  <?php
660
  }
678
  wp_localize_script(
679
  'classic-editor-plugin',
680
  'classicEditorPluginL10n',
681
+ array( 'linkText' => __( 'Switch to classic editor', 'classic-editor' ) )
682
  );
683
  }
684
 
775
 
776
  /**
777
  * Adds links to the post/page screens to edit any post or page in
778
+ * the classic editor or block editor.
779
  *
780
  * @param array $actions Post actions.
781
  * @param WP_Post $post Edited post.
810
  // Build the edit actions. See also: WP_Posts_List_Table::handle_row_actions().
811
  $title = _draft_or_post_title( $post->ID );
812
 
813
+ // Link to the block editor.
814
  $url = remove_query_arg( 'classic-editor', $edit_url );
815
+ $text = _x( 'Edit (block editor)', 'Editor Name', 'classic-editor' );
816
  /* translators: %s: post title */
817
+ $label = sprintf( __( 'Edit &#8220;%s&#8221; in the block editor', 'classic-editor' ), $title );
818
  $edit_block = sprintf( '<a href="%s" aria-label="%s">%s</a>', esc_url( $url ), esc_attr( $label ), $text );
819
 
820
+ // Link to the classic editor.
821
  $url = add_query_arg( 'classic-editor', '', $edit_url );
822
+ $text = _x( 'Edit (classic editor)', 'Editor Name', 'classic-editor' );
823
  /* translators: %s: post title */
824
+ $label = sprintf( __( 'Edit &#8220;%s&#8221; in the classic editor', 'classic-editor' ), $title );
825
  $edit_classic = sprintf( '<a href="%s" aria-label="%s">%s</a>', esc_url( $url ), esc_attr( $label ), $text );
826
 
827
  $edit_actions = array(
849
  if ( ! $editors['classic_editor'] && ! $editors['block_editor'] ) {
850
  return $post_states;
851
  } elseif ( $editors['classic_editor'] && ! $editors['block_editor'] ) {
852
+ // Forced to classic editor.
853
+ $state = '<span class="classic-editor-forced-state">' . _x( 'classic editor', 'Editor Name', 'classic-editor' ) . '</span>';
854
  } elseif ( ! $editors['classic_editor'] && $editors['block_editor'] ) {
855
+ // Forced to block editor.
856
+ $state = '<span class="classic-editor-forced-state">' . _x( 'block editor', 'Editor Name', 'classic-editor' ) . '</span>';
857
  } else {
858
  $last_editor = get_post_meta( $post->ID, 'classic-editor-remember', true );
859
 
866
  $is_classic = ( $settings['editor'] === 'classic' );
867
  }
868
 
869
+ $state = $is_classic ? _x( 'Classic editor', 'Editor Name', 'classic-editor' ) : _x( 'Block editor', 'Editor Name', 'classic-editor' );
870
  }
871
 
872
  // Fix PHP 7+ warnings if another plugin returns unexpected type.
923
  * Set defaults on activation.
924
  */
925
  public static function activate() {
926
+ register_uninstall_hook( __FILE__, array( __CLASS__, 'uninstall' ) );
927
+
928
  if ( is_multisite() ) {
929
  add_network_option( null, 'classic-editor-replace', 'classic' );
930
  add_network_option( null, 'classic-editor-allow-sites', 'disallow' );
js/block-editor-plugin.js CHANGED
@@ -8,7 +8,7 @@
8
  var createElement = wp.element.createElement;
9
  var PluginMoreMenuItem = wp.editPost.PluginMoreMenuItem;
10
  var url = wp.url.addQueryArgs( document.location.href, { 'classic-editor': '', 'classic-editor__forget': '' } );
11
- var linkText = lodash.get( window, [ 'classicEditorPluginL10n', 'linkText' ] ) || 'Switch to Classic Editor';
12
 
13
  return createElement(
14
  PluginMoreMenuItem,
8
  var createElement = wp.element.createElement;
9
  var PluginMoreMenuItem = wp.editPost.PluginMoreMenuItem;
10
  var url = wp.url.addQueryArgs( document.location.href, { 'classic-editor': '', 'classic-editor__forget': '' } );
11
+ var linkText = lodash.get( window, [ 'classicEditorPluginL10n', 'linkText' ] ) || 'Switch to classic editor';
12
 
13
  return createElement(
14
  PluginMoreMenuItem,
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: wordpressdotorg, azaozz, melchoyce, chanthaboune, alexislloyd, pento, youknowriad, desrosj, luciano-croce
3
  Tags: gutenberg, disable, disable gutenberg, editor, classic editor, block editor
4
  Requires at least: 4.9
5
- Tested up to: 5.2
6
- Stable tag: 1.4
7
  Requires PHP: 5.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -25,12 +25,16 @@ At a glance, this plugin adds the following:
25
 
26
  In addition, the Classic Editor plugin includes several filters that let other plugins control the settings, and the editor choice per post and per post type.
27
 
28
- By default, this plugin hides all functionality available in the new Block Editor ("Gutenberg").
29
 
30
  == Changelog ==
31
 
 
 
 
 
32
  = 1.5 =
33
- * Updated for WordPress 5.2 and Gutenberg 5.3+.
34
  * Enhanced and fixed the "open posts in the last editor used to edit them" logic.
35
  * Fixed adding post state so it can easily be accessed from other plugins.
36
 
@@ -38,11 +42,11 @@ By default, this plugin hides all functionality available in the new Block Edito
38
  * On network installations removed the restriction for only network activation.
39
  * Added support for network administrators to choose the default network-wide editor.
40
  * Fixed the settings link in the warning on network About screen.
41
- * Properly added the "Switch to Classic Editor" menu item to the Block Editor menu.
42
 
43
  = 1.3 =
44
  * Fixed removal of the "Try Gutenberg" dashboard widget.
45
- * Fixed condition for displaying of the after upgrade notice on the "What's New" screen. Shown when the Classic Editor is selected and users cannot switch editors.
46
 
47
  = 1.2 =
48
  * Fixed switching editors from the Add New (post) screen before a draft post is saved.
@@ -53,11 +57,11 @@ By default, this plugin hides all functionality available in the new Block Edito
53
  * Added `classic_editor_network_default_settings` filter.
54
 
55
  = 1.1 =
56
- Fixed a bug where it may attempt to load the Block Editor for post types that do not support editor when users are allowed to switch editors.
57
 
58
  = 1.0 =
59
  * Updated for WordPress 5.0.
60
- * Changed all "Gutenberg" names/references to "Block Editor".
61
  * Refreshed the settings UI.
62
  * Removed disabling of the Gutenberg plugin. This was added for testing in WordPress 4.9. Users who want to continue following the development of Gutenberg in WordPress 5.0 and beyond will not need another plugin to disable it.
63
  * Added support for per-user settings of default editor.
@@ -72,7 +76,7 @@ Fixed a bug where it may attempt to load the Block Editor for post types that do
72
  = 0.5 =
73
  * Updated for Gutenberg 4.1 and WordPress 5.0-beta1.
74
  * Removed some functionality that now exists in Gutenberg.
75
- * Fixed redirecting back to the Classic Editor after looking at post revisions.
76
 
77
  = 0.4 =
78
  * Fixed removing of the "Try Gutenberg" call-out when the Gutenberg plugin is not activated.
@@ -94,26 +98,26 @@ Initial release.
94
 
95
  = Default settings =
96
 
97
- When activated this plugin will restore the previous ("classic") WordPress editor and hide the new Block Editor ("Gutenberg").
98
  These settings can be changed at the Settings => Writing screen.
99
 
100
  = Default settings for network installation =
101
 
102
  There are two options:
103
 
104
- * When network-activated this plugin will set the Classic Editor as default and prevent site administrators and users from changing editors.
105
  The settings can be changed and default network-wide editor can be selected on the Network Settings screen.
106
  * When not network-activated each site administrator will be able to activate the plugin and choose options for their users.
107
 
108
- = Cannot find the "Switch to Classic Editor" link =
109
 
110
- It is in the main Block Editor menu, see this [screenshot](https://ps.w.org/classic-editor/assets/screenshot-7.png?rev=2023480).
111
 
112
  == Screenshots ==
113
  1. Admin settings on the Settings -> Writing screen.
114
  2. User settings on the Profile screen. Visible when the users are allowed to switch editors.
115
  3. "Action links" to choose alternative editor. Visible when the users are allowed to switch editors.
116
- 4. Link to switch to the Block Editor while editing a post in the Classic Editor. Visible when the users are allowed to switch editors.
117
- 5. Link to switch to the Classic Editor while editing a post in the Block Editor. Visible when the users are allowed to switch editors.
118
  6. Network settings to select the default editor for the network and allow site admins to change it.
119
- 7. The "Switch to Classic Editor" link.
2
  Contributors: wordpressdotorg, azaozz, melchoyce, chanthaboune, alexislloyd, pento, youknowriad, desrosj, luciano-croce
3
  Tags: gutenberg, disable, disable gutenberg, editor, classic editor, block editor
4
  Requires at least: 4.9
5
+ Tested up to: 5.7
6
+ Stable tag: 1.6
7
  Requires PHP: 5.2.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
25
 
26
  In addition, the Classic Editor plugin includes several filters that let other plugins control the settings, and the editor choice per post and per post type.
27
 
28
+ By default, this plugin hides all functionality available in the new block editor ("Gutenberg").
29
 
30
  == Changelog ==
31
 
32
+ = 1.6 =
33
+ * Updated for WordPress 5.5.
34
+ * Fixed minor issues with calling deprecated functions, needlessly registering uninstall hook, and capitalization of some strings.
35
+
36
  = 1.5 =
37
+ * Updated for WordPress 5.2 and Gutenberg 5.3.
38
  * Enhanced and fixed the "open posts in the last editor used to edit them" logic.
39
  * Fixed adding post state so it can easily be accessed from other plugins.
40
 
42
  * On network installations removed the restriction for only network activation.
43
  * Added support for network administrators to choose the default network-wide editor.
44
  * Fixed the settings link in the warning on network About screen.
45
+ * Properly added the "Switch to classic editor" menu item to the block editor menu.
46
 
47
  = 1.3 =
48
  * Fixed removal of the "Try Gutenberg" dashboard widget.
49
+ * Fixed condition for displaying of the after upgrade notice on the "What's New" screen. Shown when the classic editor is selected and users cannot switch editors.
50
 
51
  = 1.2 =
52
  * Fixed switching editors from the Add New (post) screen before a draft post is saved.
57
  * Added `classic_editor_network_default_settings` filter.
58
 
59
  = 1.1 =
60
+ Fixed a bug where it may attempt to load the block editor for post types that do not support editor when users are allowed to switch editors.
61
 
62
  = 1.0 =
63
  * Updated for WordPress 5.0.
64
+ * Changed all "Gutenberg" names/references to "block editor".
65
  * Refreshed the settings UI.
66
  * Removed disabling of the Gutenberg plugin. This was added for testing in WordPress 4.9. Users who want to continue following the development of Gutenberg in WordPress 5.0 and beyond will not need another plugin to disable it.
67
  * Added support for per-user settings of default editor.
76
  = 0.5 =
77
  * Updated for Gutenberg 4.1 and WordPress 5.0-beta1.
78
  * Removed some functionality that now exists in Gutenberg.
79
+ * Fixed redirecting back to the classic editor after looking at post revisions.
80
 
81
  = 0.4 =
82
  * Fixed removing of the "Try Gutenberg" call-out when the Gutenberg plugin is not activated.
98
 
99
  = Default settings =
100
 
101
+ When activated this plugin will restore the previous ("classic") WordPress editor and hide the new block editor ("Gutenberg").
102
  These settings can be changed at the Settings => Writing screen.
103
 
104
  = Default settings for network installation =
105
 
106
  There are two options:
107
 
108
+ * When network-activated this plugin will set the classic editor as default and prevent site administrators and users from changing editors.
109
  The settings can be changed and default network-wide editor can be selected on the Network Settings screen.
110
  * When not network-activated each site administrator will be able to activate the plugin and choose options for their users.
111
 
112
+ = Cannot find the "Switch to classic editor" link =
113
 
114
+ It is in the main block editor menu, see this [screenshot](https://ps.w.org/classic-editor/assets/screenshot-7.png?rev=2023480).
115
 
116
  == Screenshots ==
117
  1. Admin settings on the Settings -> Writing screen.
118
  2. User settings on the Profile screen. Visible when the users are allowed to switch editors.
119
  3. "Action links" to choose alternative editor. Visible when the users are allowed to switch editors.
120
+ 4. Link to switch to the block editor while editing a post in the classic editor. Visible when the users are allowed to switch editors.
121
+ 5. Link to switch to the classic editor while editing a post in the block editor. Visible when the users are allowed to switch editors.
122
  6. Network settings to select the default editor for the network and allow site admins to change it.
123
+ 7. The "Switch to classic editor" link.