Revision Control - Version 1.5

Version Description

  • Skipped 1.4
    • Sticking option values should finally be fixed.
    • Thanks to Translators, Apologies to Translators for releasing 1.5 with changes before getting updated lang files

=

Download this release

Release Info

Developer dd32
Plugin Icon wp plugin Revision Control
Version 1.5
Comparing to
See all releases

Version 1.5

langs/revision-control-it_IT.mo ADDED
Binary file
langs/revision-control-it_IT.po ADDED
@@ -0,0 +1,198 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: \n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2008-07-24 13:22+1000\n"
6
+ "PO-Revision-Date: 2008-07-24 08:03+0100\n"
7
+ "Last-Translator: \n"
8
+ "Language-Team: SteAgl <stefano.aglietti@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-Language: Italian\n"
14
+ "X-Poedit-Country: ITALY\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Poedit-KeywordsList: __;_e\n"
17
+ "X-Poedit-Basepath: ../\n"
18
+ "X-Poedit-SearchPath-0: .\n"
19
+
20
+ #: revision-control.php:39
21
+ #: revision-control.php:245
22
+ msgid "Revisions"
23
+ msgstr "Revisioni"
24
+
25
+ #: revision-control.php:39
26
+ #: revision-control.php:286
27
+ msgid "Revision Control"
28
+ msgstr "Controllo revisioni"
29
+
30
+ #: revision-control.php:126
31
+ msgid "Post Revisions"
32
+ msgstr "Revisioni articolo"
33
+
34
+ #: revision-control.php:136
35
+ msgid "Revisions:"
36
+ msgstr "Revisioni:"
37
+
38
+ #: revision-control.php:138
39
+ #: revision-control.php:296
40
+ #: revision-control.php:314
41
+ msgid "Enabled"
42
+ msgstr "Abilitate"
43
+
44
+ #: revision-control.php:140
45
+ #: revision-control.php:298
46
+ #: revision-control.php:316
47
+ msgid "Disabled"
48
+ msgstr "Disabilitate"
49
+
50
+ #: revision-control.php:142
51
+ #: revision-control.php:301
52
+ #: revision-control.php:319
53
+ msgid "Limit to"
54
+ msgstr "Limitate a"
55
+
56
+ #: revision-control.php:145
57
+ #: revision-control.php:304
58
+ #: revision-control.php:322
59
+ #, php-format
60
+ msgid "%d Revisions"
61
+ msgstr "%d revisioni"
62
+
63
+ #: revision-control.php:278
64
+ msgid "Settings saved."
65
+ msgstr "Le impostazioni sono state salvate."
66
+
67
+ #: revision-control.php:283
68
+ msgid "<strong>Error:</strong> You have defined <code>WP_POST_REVISIONS</code> in your <code>wp-config.php</code> file, In order to use this plugin you will need to remove it."
69
+ msgstr "<strong>Errore:</strong> Nel file <code>wp-config.php</code> la variabile <code>WP_POST_REVISIONS</code> è definita. Per poter usare questo plugin occorrerà rimuoverla."
70
+
71
+ #: revision-control.php:292
72
+ msgid "Default Revision Status for Posts"
73
+ msgstr "Stato predefinito revisioni per gli articoli"
74
+
75
+ #: revision-control.php:310
76
+ msgid "Default Revision Status for Pages"
77
+ msgstr "Stato predefinito revisioni per le pagine"
78
+
79
+ #: revision-control.php:329
80
+ msgid "Save Changes"
81
+ msgstr "Salva le modifiche"
82
+
83
+ #~ msgid "<h1>Add From Server</h1> Sorry, This plugin requires WordPress 2.5+"
84
+ #~ msgstr ""
85
+ #~ "<h1>Aggiungi da server</h1> Questo plugin richiede almeno WordPress 2.5+"
86
+ #~ msgid "Add From Server"
87
+ #~ msgstr "Aggiungi da server"
88
+ #~ msgid "Import"
89
+ #~ msgstr "Importa"
90
+ #~ msgid "Filename"
91
+ #~ msgstr "Nome file"
92
+ #~ msgid "Parent Folder"
93
+ #~ msgstr "Cartella madre"
94
+ #~ msgid "Toggle All"
95
+ #~ msgstr "Cambia tutti"
96
+ #~ msgid ""
97
+ #~ "Note: Will not take effect if selected file is within an upload folder at "
98
+ #~ "present"
99
+ #~ msgstr ""
100
+ #~ "Nota: Non avrà effetto se i file selezionati sono al momento nelal "
101
+ #~ "cartella di upload"
102
+ #~ msgid "Do not add selected files to current post Gallery"
103
+ #~ msgstr ""
104
+ #~ "Non aggiungere i file selezionati alla Galleria dell'articolo corrente"
105
+ #~ msgid "Import selected files"
106
+ #~ msgstr "Importa i file selezionati"
107
+ #~ msgid "<em>%s</em> has been added to Media library"
108
+ #~ msgstr "<em>%s</em> è statp aggiunto alla Libreria media"
109
+ #~ msgid "The uploaded file could not be moved to %s."
110
+ #~ msgstr "I file caricati non possono venir spostati in %s."
111
+ #~ msgid ""
112
+ #~ "Once you have selected files to be imported, Head over to the <a href=\"%s"
113
+ #~ "\">Media Library tab</a> to add them to your post."
114
+ #~ msgstr ""
115
+ #~ "Una volta selezionati i file da importare, andare sulla <a href=\"%s"
116
+ #~ "\">linguetta Libreria media</a> per aggiungerli al proprio articolo."
117
+ #~ msgid "Current Directory"
118
+ #~ msgstr "Directory corrente"
119
+ #~ msgid "Security hash missing."
120
+ #~ msgstr "Has di sicurezza mancante."
121
+ #~ msgid "You don't have enough access rights."
122
+ #~ msgstr "Non disponi dei permessi di accesso."
123
+ #~ msgid "<h2>Set Up Your FeedBurner Feed</h2>"
124
+ #~ msgstr "<h2>Imposta il tuo feed FeedBurner</h2>"
125
+ #~ msgid ""
126
+ #~ "<p>This plugin makes it easy to redirect 100% of traffic for your feeds "
127
+ #~ "to a FeedBurner feed you have created. FeedBurner can then track all of "
128
+ #~ "your feed subscriber traffic and usage and apply a variety of features "
129
+ #~ "you choose to improve and enhance your original WordPress feed.</p>"
130
+ #~ msgstr ""
131
+ #~ "<p>Questo plugin rende semplicissimo reindirizzare il 100% del traffico "
132
+ #~ "dei vostri feed ad un feed FeedBurner da voi creato. FeedBurner può "
133
+ #~ "tenere traccia di tutto il traffico e l'utilizzo effettuato dagli "
134
+ #~ "abbonati al feed ed applicare una serie di funzioni a vostra scelta per "
135
+ #~ "migliorare e incrementare il feed originale WordPress.</p>"
136
+ #~ msgid "To get started,"
137
+ #~ msgstr "Per iniziare,"
138
+ #~ msgid "create a FeedBurner feed for "
139
+ #~ msgstr "crea un feed Feedburner per "
140
+ #~ msgid "This feed will handle all traffic for your posts."
141
+ #~ msgstr "Questo feed gestirà tutto il traffico per gli articoli."
142
+ #~ msgid ""
143
+ #~ "Once you have created your FeedBurner feed, enter its address into the "
144
+ #~ "field below"
145
+ #~ msgstr ""
146
+ #~ "Una volta creato il feed su FeedBurner, inserire il suo indirizzo nel "
147
+ #~ "campo seguente"
148
+ #~ msgid ""
149
+ #~ "Optional: If you also want to handle your WordPress comments feed using "
150
+ #~ "FeedBurner"
151
+ #~ msgstr ""
152
+ #~ "Opzionale: Se si desidera gestire anche il feed dei commenti di WordPress "
153
+ #~ "utilizzando FeedBurner"
154
+ #~ msgid ""
155
+ #~ "create a FeedBurner comments feed</a> and then enter its address below:"
156
+ #~ msgstr ""
157
+ #~ "crea un feed dei commenti su FeedBurner</a> e quindi inserisci "
158
+ #~ "l'indirizzo qui sotto:"
159
+ #~ msgid "Save"
160
+ #~ msgstr "Salva"
161
+ #~ msgid "Sorry, you are not allowed to access this page."
162
+ #~ msgstr "Non ti è permesso accedere a questa pagina."
163
+ #~ msgid "ShareThis Options"
164
+ #~ msgstr "Opzioni ShareThis"
165
+ #~ msgid ""
166
+ #~ "Where do I go to get the ShareThis Code?<br><br>You can configure your "
167
+ #~ "ShareThis widget using our customizing tool (and be sure to register to "
168
+ #~ "get tracking) located here: <a href=\"http://sharethis.com/publisher?"
169
+ #~ "type=wpplugin\">sharethis.com/publisher?type=wpplugin</a>"
170
+ #~ msgstr ""
171
+ #~ "Dove andare per ottenere il Codice ShareThis?<br><br>Puoi configurare il "
172
+ #~ "tuo widget ShareThis tramite il nostro strumento di personalizzazione (e "
173
+ #~ "assicurati di registrarti per avere accesso al tracking) che si trova "
174
+ #~ "qui: <a href=\"http://sharethis.com/publisher?type=wpplugin\">sharethis."
175
+ #~ "com/publisher?type=wpplugin</a>"
176
+ #~ msgid "Paste your widget code in here:"
177
+ #~ msgstr "Incolla qui il tuo codice del widget:"
178
+ #~ msgid "Automatically add ShareThis to your posts?*"
179
+ #~ msgstr "Aggiungi automaticamente ShareThis ai tuoi articoli?*"
180
+ #~ msgid "Automatically add ShareThis to your pages?*"
181
+ #~ msgstr "Aggiungi automaticamente ShareThis alle tue pagine?*"
182
+ #~ msgid "Yes"
183
+ #~ msgstr "Si"
184
+ #~ msgid "No"
185
+ #~ msgstr "No"
186
+ #~ msgid ""
187
+ #~ "* Note, if you turn this off, you will want to add the <a href=\"http://"
188
+ #~ "support.sharethis.com/publishers/publishers-faq/wordpress/66\">ShareThis "
189
+ #~ "template tag</a> to your theme."
190
+ #~ msgstr ""
191
+ #~ "* Nota, se disabiliti questa opzione, dovrai aggiungere il <a href="
192
+ #~ "\"http://support.sharethis.com/publishers/publishers-faq/wordpress/66"
193
+ #~ "\">marcatore dei tempate di ShareThis</a> al tuo tema."
194
+ #~ msgid "Update ShareThis Options"
195
+ #~ msgstr "Aggiorna opzioni ShareThis"
196
+ #~ msgid "ShareThis"
197
+ #~ msgstr "ShareThis"
198
+
langs/revision-control-ja.mo ADDED
Binary file
langs/revision-control-ja.po ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: revison contorol ja\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2008-07-24 21:20+1000\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: tai <tekapo@gmail.com>\n"
8
+ "Language-Team: tekapo <tekapo@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-Language: Japanese\n"
13
+ "X-Poedit-Country: JAPAN\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-KeywordsList: __;_e\n"
16
+ "X-Poedit-Basepath: C:\\www\\wordpress\\wp-content\\plugins\\revision-control\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+
19
+ #: revision-control.php:39
20
+ #: revision-control.php:278
21
+ msgid "Revisions"
22
+ msgstr "リビジョン"
23
+
24
+ #: revision-control.php:42
25
+ #: revision-control.php:321
26
+ msgid "Revision Control"
27
+ msgstr "リビジョンコントロール"
28
+
29
+ #: revision-control.php:141
30
+ msgid "Post Revisions"
31
+ msgstr "投稿リビジョン"
32
+
33
+ #: revision-control.php:150
34
+ msgid "Revisions:"
35
+ msgstr "リビジョン:"
36
+
37
+ #: revision-control.php:152
38
+ #: revision-control.php:331
39
+ #: revision-control.php:349
40
+ msgid "Enabled"
41
+ msgstr "使用する"
42
+
43
+ #: revision-control.php:154
44
+ #: revision-control.php:333
45
+ #: revision-control.php:351
46
+ msgid "Disabled"
47
+ msgstr "使用しない"
48
+
49
+ #: revision-control.php:156
50
+ #: revision-control.php:336
51
+ #: revision-control.php:354
52
+ msgid "Limit to"
53
+ msgstr "次のリビジョンまで保持:"
54
+
55
+ #: revision-control.php:159
56
+ #: revision-control.php:339
57
+ #: revision-control.php:357
58
+ #, php-format
59
+ msgid "%d Revisions"
60
+ msgstr "%d リビジョン"
61
+
62
+ #: revision-control.php:247
63
+ msgid "Are you sure you wish to delete this Revision?"
64
+ msgstr "このリビジョンを削除しますか ?"
65
+
66
+ #: revision-control.php:247
67
+ msgid "(delete)"
68
+ msgstr "(削除)"
69
+
70
+ #: revision-control.php:313
71
+ msgid "Settings saved."
72
+ msgstr "設定を保存しました。"
73
+
74
+ #: revision-control.php:318
75
+ msgid "<strong>Error:</strong> You have defined <code>WP_POST_REVISIONS</code> in your <code>wp-config.php</code> file, In order to use this plugin you will need to remove it."
76
+ msgstr "<strong>エラー:</strong> <code>wp-config.php</code> ファイル内で <code>WP_POST_REVISIONS</code> が設定されています。このプラグインを利用するにはこの設定を削除してください。"
77
+
78
+ #: revision-control.php:327
79
+ msgid "Default Revision Status for Posts"
80
+ msgstr "投稿のリビジョン設定"
81
+
82
+ #: revision-control.php:345
83
+ msgid "Default Revision Status for Pages"
84
+ msgstr "ページのリビジョン設定"
85
+
86
+ #: revision-control.php:364
87
+ msgid "Save Changes"
88
+ msgstr "変更を保存"
89
+
langs/revision-control.mo ADDED
Binary file
langs/revision-control.pot ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Revision Control\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2008-07-27 18:02+1000\n"
6
+ "PO-Revision-Date: \n"
7
+ "Last-Translator: Dion Hulse <contact@dd32.id.au>\n"
8
+ "Language-Team: <contact@dd32.id.au>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "X-Poedit-Language: French\n"
13
+ "X-Poedit-Country: Australia\n"
14
+ "X-Poedit-SourceCharset: utf-8\n"
15
+ "X-Poedit-Basepath: C:\\www\\wordpress\\wp-content\\plugins\\revision-control\n"
16
+ "X-Poedit-KeywordsList: __;_e\n"
17
+ "X-Poedit-SearchPath-0: .\n"
18
+
19
+ #: revision-control.php:38
20
+ #: revision-control.php:151
21
+ #: revision-control.php:283
22
+ msgid "Revisions"
23
+ msgstr ""
24
+
25
+ #: revision-control.php:41
26
+ #: revision-control.php:326
27
+ msgid "Revision Control"
28
+ msgstr ""
29
+
30
+ #: revision-control.php:142
31
+ msgid "Post Revisions"
32
+ msgstr ""
33
+
34
+ #: revision-control.php:153
35
+ #: revision-control.php:336
36
+ #: revision-control.php:357
37
+ msgid "Enabled"
38
+ msgstr ""
39
+
40
+ #: revision-control.php:154
41
+ #: revision-control.php:157
42
+ #: revision-control.php:163
43
+ msgid " (default)"
44
+ msgstr ""
45
+
46
+ #: revision-control.php:156
47
+ #: revision-control.php:339
48
+ #: revision-control.php:360
49
+ msgid "Disabled"
50
+ msgstr ""
51
+
52
+ #: revision-control.php:163
53
+ #: revision-control.php:346
54
+ #: revision-control.php:366
55
+ #, php-format
56
+ msgid "Limit to %d Revisions"
57
+ msgstr ""
58
+
59
+ #: revision-control.php:252
60
+ msgid "Are you sure you wish to delete this Revision?"
61
+ msgstr ""
62
+
63
+ #: revision-control.php:252
64
+ msgid "(delete)"
65
+ msgstr ""
66
+
67
+ #: revision-control.php:318
68
+ msgid "Settings saved."
69
+ msgstr ""
70
+
71
+ #: revision-control.php:323
72
+ msgid "<strong>Error:</strong> You have defined <code>WP_POST_REVISIONS</code> in your <code>wp-config.php</code> file, In order to use this plugin you will need to remove it."
73
+ msgstr ""
74
+
75
+ #: revision-control.php:332
76
+ msgid "Default Revision Status for Posts"
77
+ msgstr ""
78
+
79
+ #: revision-control.php:353
80
+ msgid "Default Revision Status for Pages"
81
+ msgstr ""
82
+
83
+ #: revision-control.php:374
84
+ msgid "Save Changes"
85
+ msgstr ""
86
+
langs/translations.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
1
+ Translations of this plugin are welcome & any valid translations submitted will be included in future releases.
2
+
3
+ Please submit any translations in .mo/.po format to wordpress@dd32.id.au
4
+
5
+ Thanks :)
6
+ Dion
7
+
8
+ Thanks to Stefano for the Italian Translation (& the help for how to use poedit:))
readme.txt ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Revision Control ===
2
+ Contributors: dd32
3
+ Tags: 2.6, revisions, post, admin
4
+ Requires at least: 2.6
5
+ Tested up to: 2.7-bleeding
6
+ Stable tag: 1.5
7
+
8
+ Revision Control allows finer control over the Post Revision system included with WordPress 2.6
9
+
10
+ == Description ==
11
+
12
+ Revision Control is a plugin for WordPress 2.6+ which gives the user more control over the Post/Page Revisions.
13
+
14
+ The plugin allows the user to set a blog-global setting (Settings -> Revisions) for pages/posts to enable/disable/limit the number of revisions which are saved for the page/post. The user may change this setting on a per-page/post basis from the Revisions Meta box.
15
+
16
+ The plugin also allows the deletion of specific revisions via the Revisions post metabox.
17
+
18
+
19
+ == Changelog ==
20
+
21
+ = 1.0 =
22
+ * Initial Release
23
+ = 1.1, 1.2, 1.3 =
24
+ * Italian & Japanese Translations
25
+ * Allows Deletion of a Single revision via the Revisions post box
26
+ * The global setting has been divded into Posts and Pages, The setting should now stick past a page load
27
+ * The per-post setting should now correctly work again (After a bug introduced in 1.2)
28
+
29
+ = 1.5 =
30
+ * Skipped 1.4
31
+ * Sticking option values should finally be fixed.
32
+ * Thanks to Translators, Apologies to Translators for releasing 1.5 with changes before getting updated lang files
33
+
34
+ == Screenshots ==
35
+
36
+ 1. The Global Settings
37
+ 2. The per-post Settings
revision-control.php ADDED
@@ -0,0 +1,383 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ Plugin Name: Revision Control
4
+ Plugin URI: http://dd32.id.au/wordpress-plugins/revision-control/
5
+ Description: Allows finer control over the number of Revisions stored on a global & per-post/page basis.
6
+ Author: Dion Hulse
7
+ Version: 1.5
8
+ */
9
+
10
+ /**
11
+ * This function defines WP_POST_REVISIONS for the current post.
12
+ * Note: The define is auto-defined to true shortly after this hook is run.
13
+ */
14
+ add_action('plugins_loaded', 'rc_loaded');
15
+ function rc_loaded() {
16
+ if ( defined('WP_POST_REVISIONS') && defined('WP_ADMIN') ) {
17
+ define('RC_DEFINED_BAD', true); //Lets notify the user about this on the Revision control menu item.
18
+ return;
19
+ }
20
+
21
+ if ( ! defined('WP_ADMIN') || ! WP_ADMIN )
22
+ return;
23
+
24
+ //Ok, Time to add Admin related hooks :)
25
+ add_action('do_meta_boxes', 'rc_meta_box_manip', 15, 2);
26
+
27
+ //Now the Defines.
28
+ rc_define();
29
+ }
30
+
31
+ /**
32
+ * Add the Menu items. DOES NOT USE THE API; I'd like a bit better location than the end of the list.
33
+ */
34
+ add_action('admin_init', 'rc_admin_init');
35
+ function rc_admin_init() {
36
+ global $submenu;
37
+ //Hack into the Menu ordering
38
+ $submenu['options-general.php'][17] = array( __('Revisions', 'revision-control'),
39
+ 'manage_options',
40
+ 'revision-control',
41
+ __('Revision Control', 'revision-control')
42
+ );
43
+ ksort($submenu['options-general.php']); //Put it back in order
44
+
45
+ //Add a menu callback
46
+ add_action( get_plugin_page_hookname( 'revision-control', 'options-general.php'), 'rc_admin' );
47
+
48
+ //Load any translations.
49
+ load_plugin_textdomain( 'revision-control',
50
+ PLUGINDIR . '/' . dirname(plugin_basename(__FILE__)) . '/langs/', //2.5 Compatibility
51
+ dirname(plugin_basename(__FILE__)) . '/langs/'); //2.6+, Works with custom wp-content dirs.
52
+ }
53
+
54
+ /**
55
+ * Defined WP_POST_REVISIONS for the current post/page/etc
56
+ * Looks for Post ID's in the post and post_ID fields.
57
+ */
58
+ function rc_define() {
59
+
60
+ $defaults = get_option('revision-control');
61
+ if ( ! is_array($defaults) ) { //Upgrade from 1.0 to 1.1
62
+ if ( false === $defaults )
63
+ $defaults = true;
64
+
65
+ $defaults = array('post' => $defaults, 'page' => $defaults);
66
+ update_option('revision-control', $defaults);
67
+ }
68
+
69
+ $current_post = rc_get_page_id();
70
+
71
+ //Post or Page:
72
+ if ( ! $type = rc_get_page_type($current_post) )
73
+ return;
74
+
75
+ $revision_status = isset($defaults[ $type ]) ? $defaults[ $type ] : true;
76
+
77
+ define('RC_REVISION_DEFAULT', $revision_status);
78
+
79
+ if ( $current_post ) {
80
+ //Handle per-post/page settings.
81
+ $post_revision_status = get_post_meta($current_post, '_revision-control', true);
82
+ if ('' !== trim($post_revision_status) ) {
83
+ $revision_status = $post_revision_status;
84
+
85
+ //Eugh.. maybe_serialize() bug #7383 means integers/booleans are stored as string!
86
+ if ( is_string($revision_status) ) {
87
+ $revision_status = (int)$revision_status;
88
+ if ( (bool) $revision_status == $revision_status )
89
+ $revision_status = (bool)$revision_status;
90
+ }
91
+ }
92
+ }
93
+
94
+ @define('WP_POST_REVISIONS', $revision_status);
95
+ }
96
+
97
+ /**
98
+ * Determines if this is a Page or a Post, Or other.
99
+ */
100
+ function rc_get_page_type( $id = 0 ) {
101
+ global $pagenow;
102
+
103
+ if ( isset($_POST['post_type']) )
104
+ return $_POST['post_type'];
105
+ else if ( 'page.php' == $pagenow || 'page-new.php' == $pagenow)
106
+ return 'page';
107
+ else if ( 'post.php' == $pagenow || 'post-new.php' == $pagenow)
108
+ return 'post';
109
+ else if ( $id && $post = get_post($id) )
110
+ return $post->post_type;
111
+
112
+ return false;
113
+ }
114
+
115
+ /**
116
+ * Determines the post/page's ID based on the 'post' and 'post_ID' POST/GET fields.
117
+ */
118
+ function rc_get_page_id() {
119
+ foreach ( array( 'post_ID', 'post' ) as $field )
120
+ if ( isset( $_REQUEST[ $field ] ) )
121
+ return absint($_REQUEST[ $field ]);
122
+
123
+ if ( isset($_REQUEST['revision']) )
124
+ if ( $post = get_post( $id = absint($_REQUEST['revision']) ) )
125
+ return absint($post->post_parent);
126
+
127
+ return false;
128
+ }
129
+
130
+ /**
131
+ * Custom Revisions box
132
+ * Should use the API, But remove_meta_box followed by add_meta_box doesnt appear to add the new box
133
+ */
134
+ function rc_meta_box_manip($page, $context) {
135
+ global $wp_meta_boxes;
136
+ if ( 'advanced' != $context )
137
+ return;
138
+
139
+ if ( isset($wp_meta_boxes[ $page ][ $context ][ 'core' ][ 'revisionsdiv' ]) )
140
+ $wp_meta_boxes[ $page ][ $context ][ 'core' ][ 'revisionsdiv' ]['callback'] = 'rc_revisions_meta_box';
141
+ else
142
+ add_meta_box('revisionsdiv', __('Post Revisions'), 'rc_revisions_meta_box', $page, $context, 'core');
143
+ }
144
+
145
+ /**
146
+ * The new Revision Meta box
147
+ */
148
+ function rc_revisions_meta_box( $post ) {
149
+ rc_list_post_revisions();
150
+ ?>
151
+ <strong><?php _e('Revisions', 'revision-control') ?>:</strong>
152
+ <input name="revision-control" id="revision-control-true" type="radio" value="true" <?php
153
+ if ( WP_POST_REVISIONS === true ) echo ' checked="checked"' ?> /><label for="revision-control-true"><?php _e('Enabled', 'revision-control');
154
+ if ( RC_REVISION_DEFAULT === true ) echo '<strong>' . __(' (default)', 'revision-control') . '</strong>' ?></label>&nbsp;&nbsp;
155
+ <input name="revision-control" id="revision-control-false" type="radio" value="false" <?php
156
+ if ( WP_POST_REVISIONS === 0 ) echo ' checked="checked"' ?>/><label for="revision-control-false"><?php _e('Disabled', 'revision-control');
157
+ if ( RC_REVISION_DEFAULT === 0 ) echo '<strong>' . __(' (default)', 'revision-control') . '</strong>' ?></label> &nbsp;&nbsp;
158
+ <input name="revision-control" id="revision-control-number" type="radio" value="number" <?php
159
+ if ( WP_POST_REVISIONS > 1 ) echo ' checked="checked"' ?>/>
160
+ <label for="revision-control-number">
161
+ <select name="revision-control-number" onclick="jQuery('#revision-control-number').attr('checked', 'checked');">
162
+ <?php for ( $i = 2; $i < 15; $i++ ) : ?>
163
+ <option value="<?php echo $i ?>"<?php if ( WP_POST_REVISIONS === $i ) echo ' selected="selected"'
164
+ ?>><?php printf( __('Limit to %d Revisions', 'revision-control'), $i);
165
+ if ( RC_REVISION_DEFAULT == $i ) _e(' (default)', 'revision-control'); ?></option>
166
+ <?php endfor; ?>
167
+ </select>
168
+ </label>
169
+ <?php
170
+ }
171
+
172
+ /**
173
+ * Sets the per-post revision status. Also deletes any now-stale revisions.
174
+ */
175
+ add_action('save_post', 'rc_perpost_value');
176
+ function rc_perpost_value($post_ID) {
177
+ if ( ! isset($_POST['revision-control']) )
178
+ return;
179
+ if ( 'number' == $_POST['revision-control'] && ! isset($_POST['revision-control-number']) )
180
+ return;
181
+
182
+ switch ( $_POST['revision-control'] ) {
183
+ case 'true':
184
+ if ( RC_REVISION_DEFAULT === true && '' === get_post_meta($post_ID, '_revision-control') )
185
+ return;
186
+
187
+ update_post_meta($post_ID, '_revision-control', true);
188
+ $number_to_delete = false;
189
+ break;
190
+ case 'false':
191
+ if ( RC_REVISION_DEFAULT === 0 && '' === get_post_meta($post_ID, '_revision-control') )
192
+ return;
193
+
194
+ update_post_meta($post_ID, '_revision-control', 0);
195
+ $number_to_delete = 0;
196
+ break;
197
+ case 'number':
198
+ $number_to_delete = (int)$_POST['revision-control-number'];
199
+ if ( RC_REVISION_DEFAULT === $number_to_delete && '' === get_post_meta($post_ID, '_revision-control') )
200
+ return;
201
+
202
+ update_post_meta($post_ID, '_revision-control', $number_to_delete);
203
+ break;
204
+ default:
205
+ //Abort! Abort!
206
+ return;
207
+ }
208
+
209
+ if ( is_integer($number_to_delete) ) {
210
+ // all revisions and (possibly) one autosave
211
+ $revisions = wp_get_post_revisions( $post_ID, array( 'order' => 'ASC' ) );
212
+
213
+ //Number to delete, based on option.
214
+ $delete = count($revisions) - $number_to_delete;
215
+
216
+ if ( $delete < 1 )
217
+ return $return;
218
+
219
+ $revisions = array_slice( $revisions, 0, $delete );
220
+
221
+ foreach ( (array)$revisions as $revision )
222
+ if ( false === strpos( $revision->post_name, 'autosave' ) )
223
+ wp_delete_post_revision( $revision->ID );
224
+ }
225
+ }
226
+
227
+ /**
228
+ * Copy of wp_list_post_revisions() w/ non-list support stripped out.
229
+ *
230
+ */
231
+ function rc_list_post_revisions( $post_id = 0 ) {
232
+ if ( !$post = get_post( $post_id ) )
233
+ return;
234
+
235
+ if ( !$revisions = wp_get_post_revisions( $post->ID ) )
236
+ return;
237
+
238
+ $titlef = _c( '%1$s by %2$s|post revision 1:datetime, 2:name' );
239
+
240
+ echo "<ul class='post-revisions'>\n";
241
+ foreach ( $revisions as $revision ) {
242
+ if ( !current_user_can( 'read_post', $revision->ID ) )
243
+ continue;
244
+ if ( 'revision' === $type && wp_is_post_autosave( $revision ) )
245
+ continue;
246
+
247
+ $date = wp_post_revision_title( $revision );
248
+ $name = get_author_name( $revision->post_author );
249
+
250
+ $title = sprintf( $titlef, $date, $name );
251
+ if ( current_user_can( 'edit_post', $revision->ID ) ) {
252
+ $url = wp_nonce_url('admin-post.php?action=delete-revision&revision=' . $revision->ID, 'delete_revision-' . $revision->ID);
253
+ $title .= sprintf(' <a href="' . $url . '" onclick="return confirm(\'%s\')">%s</a>', js_escape(__('Are you sure you wish to delete this Revision?', 'revision-control')), __('(delete)', 'revision-control'));
254
+ }
255
+ echo "\t<li>$title</li>\n";
256
+ }
257
+ echo "</ul>";
258
+
259
+ }
260
+
261
+ /**
262
+ * Deletes a Revision
263
+ */
264
+ add_action('admin_post_delete-revision', 'rc_delete_revision');
265
+ function rc_delete_revision() {
266
+ $revision = absint($_REQUEST['revision']);
267
+ if ( $revision ) {
268
+ check_admin_referer('delete_revision-' . $revision);
269
+ if ( current_user_can('delete_post', $revision) )
270
+ wp_delete_post_revision( $revision );
271
+ }
272
+ wp_safe_redirect(wp_get_referer());
273
+ }
274
+
275
+ /**
276
+ * Add the Plugin action link.
277
+ */
278
+ add_filter('plugin_action_links', 'rc_plugins_filter', 10, 2);
279
+ function rc_plugins_filter($links, $plugin) {
280
+ static $this_plugin;
281
+ if( ! $this_plugin )
282
+ $this_plugin = plugin_basename(__FILE__);
283
+
284
+ if( $plugin == $this_plugin ) {
285
+ $links = array_merge( array('<a href="options-general.php?page=revision-control">' . __('Revisions', 'revision-control') . '</a>'), $links);
286
+ remove_filter('plugin_action_links', 'rc_plugins_filter'); //Nice citizens, We dont *really* need to check anymore.
287
+ }
288
+
289
+ return $links;
290
+ }
291
+
292
+ /**
293
+ * The admin page, Handles saving the setting too.
294
+ * checked() / selected() cannot save us, need a === instead of ==
295
+ */
296
+ function rc_admin() {
297
+ $defaults = get_option('revision-control');
298
+
299
+ if ( 'POST' == strtoupper($_SERVER['REQUEST_METHOD']) ) {
300
+ check_admin_referer('update-options');
301
+
302
+ foreach ( array('post', 'page') as $field ) {
303
+ if ( ! isset($_POST['revision-control-' . $field]) )
304
+ continue;
305
+
306
+ switch ( $_POST['revision-control-' . $field] ) {
307
+ case 'true':
308
+ $defaults[ $field ] = true;
309
+ break;
310
+ case 'false':
311
+ $defaults[ $field ] = 0;
312
+ break;
313
+ case 'number':
314
+ $defaults[ $field ] = (int)$_POST['revision-control-' . $field . '-number'];
315
+ break;
316
+ }
317
+ }
318
+ if ( $defaults !== get_option('revision-control') ) {
319
+ update_option('revision-control', $defaults);
320
+ echo '<div id="message" class="updated fade"><p><strong>' . __('Settings saved.', 'revision-control') . '</strong></p></div>';
321
+ }
322
+ }
323
+ ?>
324
+ <?php if ( defined('RC_DEFINED_BAD') ) : ?>
325
+ <div class="message error"><p><?php _e('<strong>Error:</strong> You have defined <code>WP_POST_REVISIONS</code> in your <code>wp-config.php</code> file, In order to use this plugin you will need to remove it.', 'revision-control') ?></p></div>
326
+ <?php endif; ?>
327
+ <div class="wrap">
328
+ <h2><?php _e('Revision Control', 'revision-control') ?></h2>
329
+ <form method="post" action="options-general.php?page=revision-control">
330
+ <?php wp_nonce_field('update-options') ?>
331
+
332
+ <table class="form-table">
333
+ <tr valign="top">
334
+ <th scope="row"><label for="revision-control-post"> <?php _e('Default Revision Status for Posts', 'revision-control') ?></label></th>
335
+ <td>
336
+ <input name="revision-control-post" id="revision-control-post-true" type="radio" value="true" <?php
337
+ if ( $defaults['post'] === true || $defaults['post'] === false ) echo ' checked="checked"' ?> />
338
+ <label for="revision-control-post-true"><?php _e('Enabled', 'revision-control') ?></label><br />
339
+ <input name="revision-control-post" id="revision-control-post-false" type="radio" value="false" <?php
340
+ if ( $defaults['post'] === 0 ) echo ' checked="checked"' ?>/>
341
+ <label for="revision-control-post-false"><?php _e('Disabled', 'revision-control') ?></label><br />
342
+ <input name="revision-control-post" id="revision-control-post-number" type="radio" value="number" <?php
343
+ if ( is_numeric( $defaults['post'] ) && $defaults['post'] > 1 ) echo ' checked="checked"' ?>/>
344
+ <label for="revision-control-post-number">
345
+ <select name="revision-control-post-number" onclick="jQuery('#revision-control-post-number').attr('checked', 'checked');">
346
+ <?php for ( $i = 2; $i < 15; $i++ ) : ?>
347
+ <option value="<?php echo $i ?>"<?php if ( WP_POST_REVISIONS === $i ) echo ' selected="selected"'
348
+ ?>><?php printf( __('Limit to %d Revisions', 'revision-control'), $i) ?></option>
349
+ <?php endfor; ?>
350
+ </select>
351
+ </label>
352
+ </td>
353
+ </tr>
354
+ <tr valign="top">
355
+ <th scope="row"><label for="revision-control-page"> <?php _e('Default Revision Status for Pages', 'revision-control') ?></label></th>
356
+ <td>
357
+ <input name="revision-control-page" id="revision-control-page-true" type="radio" value="true" <?php
358
+ if ( $defaults['page'] === true || $defaults['page'] === false ) echo ' checked="checked"' ?> />
359
+ <label for="revision-control-page-true"><?php _e('Enabled', 'revision-control') ?></label><br />
360
+ <input name="revision-control-page" id="revision-control-page-false" type="radio" value="false" <?php
361
+ if ( $defaults['page'] === 0 ) echo ' checked="checked"' ?>/>
362
+ <label for="revision-control-page-false"><?php _e('Disabled', 'revision-control') ?></label><br />
363
+ <input name="revision-control-page" id="revision-control-page-number" type="radio" value="number" <?php
364
+ if ( is_numeric( $defaults['page'] ) && $defaults['post'] > 1 ) echo ' checked="checked"' ?>/>
365
+ <label for="revision-control-page-number">
366
+ <select name="revision-control-page-number" onclick="jQuery('#revision-control-page-number').attr('checked', 'checked');">
367
+ <?php for ( $i = 2; $i < 15; $i++ ) : ?>
368
+ <option value="<?php echo $i ?>"<?php if ( WP_POST_REVISIONS === $i ) echo ' selected="selected"' ?>><?php printf( __('Limit to %d Revisions', 'revision-control'), $i) ?></option>
369
+ <?php endfor; ?>
370
+ </select>
371
+ </label>
372
+ </td>
373
+ </tr>
374
+ </table>
375
+ <p class="submit">
376
+ <input type="submit" name="Submit" value="<?php _e('Save Changes', 'revision-control') ?>" />
377
+ </p>
378
+ </form>
379
+ </div>
380
+ <?php
381
+ }
382
+
383
+ ?>
screenshot-1.png ADDED
Binary file
screenshot-2.png ADDED
Binary file