Re-add text underline and justify - Version 0.1

Version Description

  • 11/06/2016 =
  • First release.

=

Download this release

Release Info

Developer briKou
Plugin Icon Re-add text underline and justify
Version 0.1
Comparing to
See all releases

Version 0.1

index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ //Kisses from France...
langs/re-add-underline-justify-fr_FR.mo ADDED
Binary file
langs/re-add-underline-justify-fr_FR.po ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Re-add text underline and justify v0.1\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2016-11-06 12:22:32+0000\n"
7
+ "Last-Translator: Brice Capobianco\n"
8
+ "Language-Team: \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-Generator: CSL v1.x\n"
14
+ "X-Poedit-Language: French\n"
15
+ "X-Poedit-Country: FRANCE\n"
16
+ "X-Poedit-SourceCharset: utf-8\n"
17
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;\n"
18
+ "X-Poedit-Basepath: ../\n"
19
+ "X-Poedit-Bookmarks: \n"
20
+ "X-Poedit-SearchPath-0: .\n"
21
+ "X-Textdomain-Support: yes"
22
+
23
+ #. translators: plugin header field 'Name'
24
+ #: re-add-underline-justify.php:0
25
+ #@ re-add-underline-justify
26
+ msgid "Re-add text underline and justify"
27
+ msgstr "Re-add text underline and justify"
28
+
29
+ #. translators: plugin header field 'PluginURI'
30
+ #. translators: plugin header field 'AuthorURI'
31
+ #: re-add-underline-justify.php:0
32
+ #@ re-add-underline-justify
33
+ msgid "http:// b-website.com/"
34
+ msgstr "http:// b-website.com/"
35
+
36
+ #. translators: plugin header field 'Description'
37
+ #: re-add-underline-justify.php:0
38
+ #@ re-add-underline-justify
39
+ msgid "This very simple plugin re-adds the Editor text underline, text justify and rearrange buttons as they were before WordPress 4.7."
40
+ msgstr "Ce plugin permet de remettre en place les boutons pour souligner et justifier le texte et de réorganiser les boutons comme ils l'étaient avant WordPress 4.7."
41
+
42
+ #. translators: plugin header field 'Author'
43
+ #: re-add-underline-justify.php:0
44
+ #@ re-add-underline-justify
45
+ msgid "Brice Capobianco"
46
+ msgstr "Brice Capobianco"
47
+
48
+ #. translators: plugin header field 'Version'
49
+ #: re-add-underline-justify.php:0
50
+ #@ re-add-underline-justify
51
+ msgid "0.1"
52
+ msgstr "0.1"
53
+
54
+ #: re-add-underline-justify.php:43
55
+ #@ simple-revisions-delete
56
+ msgid "More b*web Plugins"
57
+ msgstr ""
58
+
59
+ #: re-add-underline-justify.php:44
60
+ #@ default
61
+ msgid "Donate to this plugin &#187;"
62
+ msgstr ""
63
+
64
+ #: re-add-underline-justify.php:89
65
+ #@ re-add-underline-justify
66
+ msgid "Editor style"
67
+ msgstr "Style de l'éditeur"
68
+
69
+ #: re-add-underline-justify.php:114
70
+ #@ re-add-underline-justify
71
+ msgid "Default - without underline & justify buttons"
72
+ msgstr "Défaut - sans les boutons souligner & justifier"
73
+
74
+ #: re-add-underline-justify.php:115
75
+ #@ re-add-underline-justify
76
+ msgid "Re-add underline & justify buttons"
77
+ msgstr "Ajouter les boutons souligner & justifier"
78
+
79
+ #: re-add-underline-justify.php:116
80
+ #@ re-add-underline-justify
81
+ msgid "Re-add underline & justify + rearrange"
82
+ msgstr "Ajouter les boutons souligner & justifier + les réordonner"
83
+
re-add-underline-justify.php ADDED
@@ -0,0 +1,241 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Plugin Name: Re-add text underline and justify
4
+ * Plugin URI: http://b-website.com/re-add-text-underline-and-justify
5
+ * Description: This very simple plugin re-adds the Editor text underline, text justify and rearrange buttons as they were before WordPress 4.7.
6
+ * Author: Brice Capobianco
7
+ * Version: 0.1
8
+ * Author URI: http:// b-website.com/
9
+ * Domain Path: /langs
10
+ * Text Domain: re-add-underline-justify
11
+ */
12
+
13
+ /* Copyright 2016 Brice CAPOBIANCO (contact : http:// b-website.com/contact)
14
+
15
+ This program is free software; you can redistribute it and/or modify
16
+ it under the terms of the GNU General Public License, version 2, as
17
+ published by the Free Software Foundation.
18
+
19
+ This program is distributed in the hope that it will be useful,
20
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
21
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
+ GNU General Public License for more details.
23
+
24
+ You should have received a copy of the GNU General Public License
25
+ along with this program; if not, write to the Free Software
26
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
+ */
28
+
29
+
30
+ /***************************************************************
31
+ * SECURITY : Exit if accessed directly
32
+ ***************************************************************/
33
+ if ( !defined( 'ABSPATH' ) ) {
34
+ die( 'Direct access not allowed!' );
35
+ }
36
+
37
+
38
+ /***************************************************************
39
+ * Add custom meta link on plugin list page
40
+ ***************************************************************/
41
+ function ratb_meta_links( $links, $file ) {
42
+ if ( $file === 're-add-underline-justify/re-add-underline-justify.php' ) {
43
+ $links[] = '<a href="http:// b-website.com/category/plugins" target="_blank" title="' . __( 'More b*web Plugins', 'simple-revisions-delete' ) . '">'. __( 'More b*web Plugins', 'simple-revisions-delete' ) .'</a>';
44
+ $links[] = '<a href="https:// www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7Z6YVM63739Y8" target="_blank" title="' . __( 'Donate to this plugin &#187;' ) . '"><strong>' . __( 'Donate to this plugin &#187;' ) . '</strong></a>';
45
+ }
46
+ return $links;
47
+ }
48
+ add_filter( 'plugin_row_meta', 'ratb_meta_links', 10, 2 );
49
+
50
+
51
+ /***************************************************************
52
+ * Load plugin textdomain
53
+ ***************************************************************/
54
+ function ratb_load_textdomain() {
55
+ $path = dirname( plugin_basename( __FILE__ ) ) . '/langs/';
56
+ load_plugin_textdomain( 're-add-underline-justify', FALSE, $path );
57
+ }
58
+ add_action( 'init', 'ratb_load_textdomain' );
59
+
60
+
61
+ /***************************************************************
62
+ * Remove plugin settings from DB on plugin deletion
63
+ ***************************************************************/
64
+ function ratb_uninstall() {
65
+ // Remove option from DB
66
+ delete_option( 'ratb_options' );
67
+ }
68
+
69
+
70
+ /***************************************************************
71
+ * Hooks for install & uninstall
72
+ ***************************************************************/
73
+ function ratb_activation() {
74
+ register_uninstall_hook( __FILE__, 'ratb_uninstall' );
75
+ }
76
+ register_activation_hook( __FILE__, 'ratb_activation' );
77
+
78
+
79
+ /***************************************************************
80
+ * Register the new setting on the Wrinting screen
81
+ ***************************************************************/
82
+ function ratb_admin_init(){
83
+ register_setting(
84
+ 'writing', // settings page
85
+ 'ratb_options' // option name
86
+ );
87
+ add_settings_field(
88
+ 'ratb_mce_style', // id
89
+ __( 'Editor style', 're-add-underline-justify' ), // setting title
90
+ 'ratb_setting_input', // display callback
91
+ 'writing', // settings page
92
+ 'default' // settings section
93
+ );
94
+ }
95
+ add_action('admin_init', 'ratb_admin_init');
96
+
97
+
98
+ /***************************************************************
99
+ * Display the select on the Wrinting screen
100
+ ***************************************************************/
101
+ function ratb_setting_input() {
102
+
103
+ //Retrieve the option value
104
+ $options = get_option( 'ratb_options' );
105
+
106
+ //Default value
107
+ if( empty( $options ) ){
108
+ $options['ratb_mce_style'] = 1;
109
+ }
110
+
111
+ // Output the field
112
+ echo '
113
+ <select id="ratb_mce_style" name="ratb_options[ratb_mce_style]">
114
+ <option value="1"' . selected( $options['ratb_mce_style'], 1, false ) . '>' . __( 'Default - without underline & justify buttons', 're-add-underline-justify' ) . '</option>
115
+ <option value="2"' . selected( $options['ratb_mce_style'], 2, false ) . '>' . __( 'Re-add underline & justify buttons', 're-add-underline-justify' ) . '</option>
116
+ <option value="3"' . selected( $options['ratb_mce_style'], 3, false ) . '>' . __( 'Re-add underline & justify + rearrange', 're-add-underline-justify' ) . '</option>
117
+ </select>';
118
+
119
+ }
120
+
121
+
122
+ /***************************************************************
123
+ * Update tinyMCE buttons lines
124
+ ***************************************************************/
125
+ function ratb_buttons_lines_tiny_mce(){
126
+
127
+ //Retrieve the option value
128
+ $options = get_option( 'ratb_options' );
129
+
130
+ // Conditionnal MCE display
131
+ if ( isset( $options['ratb_mce_style'] ) && $options['ratb_mce_style'] == 2 ) {
132
+
133
+ add_filter( 'mce_buttons', 'ratb_tiny_mce_buttons' );
134
+ add_filter( 'mce_buttons_2', 'ratb_tiny_mce_buttons_2' );
135
+
136
+ } else if ( isset( $options['ratb_mce_style'] ) && $options['ratb_mce_style'] == 3 ) {
137
+
138
+ add_filter( 'mce_buttons', 'ratb_tiny_mce_buttons_rearrange' );
139
+ add_filter( 'mce_buttons_2', 'ratb_tiny_mce_buttons_2_rearrange' );
140
+
141
+ }
142
+ //Else, do nothing... use the default editor style
143
+
144
+ }
145
+ add_filter( 'the_editor_content', 'ratb_buttons_lines_tiny_mce', 9 );
146
+
147
+
148
+ /***************************************************************
149
+ * First editor row buttons - 4.6
150
+ ***************************************************************/
151
+ function ratb_tiny_mce_buttons( $buttons_array ){
152
+ $mce_buttons = array(
153
+ 'bold', // Applies the bold format to the current selection.
154
+ 'italic', // Applies the italic format to the current selection.
155
+ 'strikethrough', // Applies strike though format to the current selection.
156
+ 'bullist', // Formats the current selection as a bullet list.
157
+ 'numlist', // Formats the current selection as a numbered list.
158
+ 'blockquote', // Applies block quote format to the current block level element.
159
+ 'hr', // Inserts a horizontal rule into the editor.
160
+ 'alignleft', // Left aligns the current block or image.
161
+ 'aligncenter', // Left aligns the current block or image.
162
+ 'alignright', // Right aligns the current block or image.
163
+ 'link', // Creates/Edits links within the editor.
164
+ 'unlink', // Removes links from the current selection.
165
+ 'wp_more', // Inserts the <!-- more --> tag.
166
+ 'spellchecker', // ???
167
+ 'wp_adv', // Toggles the second toolbar on/off.
168
+ 'dfw' // Distraction-free mode on/off.
169
+ );
170
+ return $mce_buttons;
171
+ }
172
+
173
+
174
+ /***************************************************************
175
+ * Second editor row buttons - 4.6
176
+ ***************************************************************/
177
+ function ratb_tiny_mce_buttons_2( $buttons_array ){
178
+ $mce_buttons_2 = array(
179
+ 'formatselect', // Dropdown list with block formats to apply to selection.
180
+ 'underline', // Applies the underline format to the current selection.
181
+ 'alignjustify', // Full aligns the current block or image.
182
+ 'forecolor', // Applies foreground/text color to selection.
183
+ 'pastetext', // Toggles plain text pasting mode on/off.
184
+ 'removeformat', // Removes the formatting from the current selection.
185
+ 'charmap', // Inserts custom characters into the editor.
186
+ 'outdent', // Outdents the current list item or block element.
187
+ 'indent', // Indents the current list item or block element.
188
+ 'undo', // Undoes the last operation.
189
+ 'redo', // Redoes the last undoed operation.
190
+ 'wp_help' // Opens the help.
191
+ );
192
+ return $mce_buttons_2;
193
+ }
194
+
195
+
196
+ /***************************************************************
197
+ * First editor row buttons - 4.7 + rearrange
198
+ ***************************************************************/
199
+ function ratb_tiny_mce_buttons_rearrange( $buttons_array ){
200
+ $mce_buttons = array(
201
+ 'formatselect', // Dropdown list with block formats to apply to selection.
202
+ 'bold', // Applies the bold format to the current selection.
203
+ 'italic', // Applies the italic format to the current selection.
204
+ 'underline', // Applies the underline format to the current selection.
205
+ 'bullist', // Formats the current selection as a bullet list.
206
+ 'numlist', // Formats the current selection as a numbered list.
207
+ 'blockquote', // Applies block quote format to the current block level element.
208
+ 'hr', // Inserts a horizontal rule into the editor.
209
+ 'alignleft', // Left aligns the current block or image.
210
+ 'aligncenter', // Left aligns the current block or image.
211
+ 'alignright', // Right aligns the current block or image.
212
+ 'alignjustify', // Full aligns the current block or image.
213
+ 'link', // Creates/Edits links within the editor.
214
+ 'unlink', // Removes links from the current selection.
215
+ 'wp_more', // Inserts the <!-- more --> tag.
216
+ 'spellchecker', // ???
217
+ 'wp_adv', // Toggles the second toolbar on/off.
218
+ 'dfw' // Distraction-free mode on/off.
219
+ );
220
+ return $mce_buttons;
221
+ }
222
+
223
+
224
+ /***************************************************************
225
+ * Second editor row buttons - 4.7 + rearrange
226
+ ***************************************************************/
227
+ function ratb_tiny_mce_buttons_2_rearrange( $buttons_array ){
228
+ $mce_buttons_2 = array(
229
+ 'strikethrough', // Applies strike though format to the current selection.
230
+ 'forecolor', // Applies foreground/text color to selection.
231
+ 'pastetext', // Toggles plain text pasting mode on/off.
232
+ 'removeformat', // Removes the formatting from the current selection.
233
+ 'charmap', // Inserts custom characters into the editor.
234
+ 'outdent', // Outdents the current list item or block element.
235
+ 'indent', // Indents the current list item or block element.
236
+ 'undo', // Undoes the last operation.
237
+ 'redo', // Redoes the last undoed operation.
238
+ 'wp_help' // Opens the help.
239
+ );
240
+ return $mce_buttons_2;
241
+ }
readme.txt ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Re-add text underline and justify ===
2
+ Contributors: briKou
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7Z6YVM63739Y8
4
+ Tags: mce, editor, underline, justify, tinyMCE, 4.7, wysiwyg, visual editor
5
+ Requires at least: 4.7
6
+ Tested up to: 4.7
7
+ Stable tag: 0.1
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
+
11
+ This very simple plugin re-adds the Editor text underline, text justify and rearrange buttons as they were before WordPress 4.7.
12
+
13
+
14
+ == Description ==
15
+
16
+ In WordPress 4.7, the core developper team decided to make various changes in the editor, including removing the **underline and justify buttons** and rearranging some of the toolbar buttons.
17
+ If you don't want to change the way you edit your content and/or don't want to confuse your customers with a new contribution interface, this simple and lightweight plugin will set the editor style back to its previous state.
18
+
19
+ **You may change the Editor style from the Writing option page.**
20
+
21
+ 3 options are available for the Editor style :
22
+
23
+ * Default - without underline & justify buttons
24
+ * Re-add underline & justify buttons
25
+ * Re-add underline & justify + rearrange
26
+
27
+ Please note, the third option is, in my opinion, a good compromise between the 4.6 and 4.7 editor versions.
28
+
29
+ [DOCUMENTATION](http://b-website.com/re-add-text-underline-and-justify "Plugin documentation")
30
+
31
+ [CHECK OUT MY OTHER PLUGINS](http://b-website.com/category/plugins-en "More plugins by b*web")
32
+
33
+
34
+ **Please ask for help or report bugs if anything goes wrong. It is the best way to make the community benefit!**
35
+
36
+
37
+ == Installation ==
38
+
39
+ 1. Upload and activate the plugin (or install it through the WP admin console)
40
+ 2. Go to Settings -> Writing and select the option you want under "Editor style".
41
+ 3. That's it, it is ready to use!
42
+
43
+ == Frequently Asked Questions ==
44
+
45
+ = Where can I change the Editor style? =
46
+ Just go to Settings -> Writing and select the option you want under "Editor style".
47
+
48
+
49
+ == Screenshots ==
50
+
51
+ 1. Change the Editor style from the Writing option page
52
+ 2. Default - without underline & justify buttons
53
+ 3. Re-add underline & justify buttons
54
+ 4. Re-add underline & justify + rearrange
55
+
56
+
57
+ == Changelog ==
58
+
59
+ = 0.1 - 11/06/2016 =
60
+ * First release.
61
+
62
+ == Upgrade Notice ==
63
+
64
+ = 0.1 =
65
+ * First release.