Version Description
- 01/14/2016 =
- Added the fourth option to only re-add justify button (push methode)
- Push non standard button to the end of the buttons lines for the third option. This prevent from removing extra buttons added by other plugins.
- Fix for ACF (free) on the second option
Download this release
Release Info
| Developer | briKou |
| Plugin | |
| Version | 0.1.3 |
| Comparing to | |
| See all releases | |
Code changes from version 0.1.2 to 0.1.3
- langs/re-add-underline-justify-fr_FR.mo +0 -0
- langs/re-add-underline-justify-fr_FR.po +25 -15
- re-add-underline-justify.php +99 -16
- readme.txt +18 -7
langs/re-add-underline-justify-fr_FR.mo
CHANGED
|
Binary file
|
langs/re-add-underline-justify-fr_FR.po
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 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:
|
| 7 |
"Last-Translator: Brice Capobianco\n"
|
| 8 |
"Language-Team: \n"
|
| 9 |
"MIME-Version: 1.0\n"
|
|
@@ -26,7 +26,6 @@ msgstr ""
|
|
| 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
|
|
@@ -45,39 +44,50 @@ msgstr "Ce plugin permet de remettre en place les boutons pour souligner et just
|
|
| 45 |
msgid "Brice Capobianco"
|
| 46 |
msgstr "Brice Capobianco"
|
| 47 |
|
| 48 |
-
|
| 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:
|
| 60 |
#@ default
|
| 61 |
msgid "Donate to this plugin »"
|
| 62 |
msgstr ""
|
| 63 |
|
| 64 |
-
#: re-add-underline-justify.php:
|
| 65 |
#@ re-add-underline-justify
|
| 66 |
msgid "Editor style"
|
| 67 |
msgstr "Style de l'éditeur"
|
| 68 |
|
| 69 |
-
#: re-add-underline-justify.php:
|
| 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:
|
| 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:
|
| 80 |
#@ re-add-underline-justify
|
| 81 |
msgid "Re-add underline & justify + rearrange"
|
| 82 |
msgstr "Ajouter les boutons souligner & justifier + les réordonner"
|
| 83 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
msgid ""
|
| 2 |
msgstr ""
|
| 3 |
+
"Project-Id-Version: Re-add text underline and justify v0.1.3\n"
|
| 4 |
"Report-Msgid-Bugs-To: \n"
|
| 5 |
"POT-Creation-Date: \n"
|
| 6 |
+
"PO-Revision-Date: 2017-01-14 11:35:24+0000\n"
|
| 7 |
"Last-Translator: Brice Capobianco\n"
|
| 8 |
"Language-Team: \n"
|
| 9 |
"MIME-Version: 1.0\n"
|
| 26 |
msgid "Re-add text underline and justify"
|
| 27 |
msgstr "Re-add text underline and justify"
|
| 28 |
|
|
|
|
| 29 |
#. translators: plugin header field 'AuthorURI'
|
| 30 |
#: re-add-underline-justify.php:0
|
| 31 |
#@ re-add-underline-justify
|
| 44 |
msgid "Brice Capobianco"
|
| 45 |
msgstr "Brice Capobianco"
|
| 46 |
|
| 47 |
+
#: re-add-underline-justify.php:44
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
#@ simple-revisions-delete
|
| 49 |
msgid "More b*web Plugins"
|
| 50 |
msgstr ""
|
| 51 |
|
| 52 |
+
#: re-add-underline-justify.php:45
|
| 53 |
#@ default
|
| 54 |
msgid "Donate to this plugin »"
|
| 55 |
msgstr ""
|
| 56 |
|
| 57 |
+
#: re-add-underline-justify.php:90
|
| 58 |
#@ re-add-underline-justify
|
| 59 |
msgid "Editor style"
|
| 60 |
msgstr "Style de l'éditeur"
|
| 61 |
|
| 62 |
+
#: re-add-underline-justify.php:115
|
| 63 |
#@ re-add-underline-justify
|
| 64 |
msgid "Default - without underline & justify buttons"
|
| 65 |
msgstr "Défaut - sans les boutons souligner & justifier"
|
| 66 |
|
| 67 |
+
#: re-add-underline-justify.php:116
|
| 68 |
#@ re-add-underline-justify
|
| 69 |
msgid "Re-add underline & justify buttons"
|
| 70 |
msgstr "Ajouter les boutons souligner & justifier"
|
| 71 |
|
| 72 |
+
#: re-add-underline-justify.php:117
|
| 73 |
#@ re-add-underline-justify
|
| 74 |
msgid "Re-add underline & justify + rearrange"
|
| 75 |
msgstr "Ajouter les boutons souligner & justifier + les réordonner"
|
| 76 |
|
| 77 |
+
#. translators: plugin header field 'PluginURI'
|
| 78 |
+
#: re-add-underline-justify.php:0
|
| 79 |
+
#@ re-add-underline-justify
|
| 80 |
+
msgid "http://b-website.com/re-add-text-underline-and-justify"
|
| 81 |
+
msgstr "https://www.b-website.com/remettre-place-boutons-souligner-justifier-de-lediteur-wordpress-4-7"
|
| 82 |
+
|
| 83 |
+
#. translators: plugin header field 'Version'
|
| 84 |
+
#: re-add-underline-justify.php:0
|
| 85 |
+
#@ re-add-underline-justify
|
| 86 |
+
msgid "0.1.3"
|
| 87 |
+
msgstr ""
|
| 88 |
+
|
| 89 |
+
#: re-add-underline-justify.php:118
|
| 90 |
+
#@ re-add-underline-justify
|
| 91 |
+
msgid "Re-add justify only"
|
| 92 |
+
msgstr "Ajouter uniquement le bouton justifier"
|
| 93 |
+
|
re-add-underline-justify.php
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
<?php
|
| 2 |
/*
|
| 3 |
* Plugin Name: Re-add text underline and justify
|
| 4 |
-
* Plugin URI:
|
| 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:
|
| 9 |
* Domain Path: /langs
|
| 10 |
* Text Domain: re-add-underline-justify
|
| 11 |
*/
|
|
@@ -31,7 +31,9 @@
|
|
| 31 |
* SECURITY : Exit if accessed directly
|
| 32 |
***************************************************************/
|
| 33 |
if ( !defined( 'ABSPATH' ) ) {
|
|
|
|
| 34 |
die( 'Direct access not allowed!' );
|
|
|
|
| 35 |
}
|
| 36 |
|
| 37 |
|
|
@@ -39,11 +41,14 @@ if ( !defined( 'ABSPATH' ) ) {
|
|
| 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="
|
| 45 |
}
|
| 46 |
return $links;
|
|
|
|
| 47 |
}
|
| 48 |
add_filter( 'plugin_row_meta', 'ratb_meta_links', 10, 2 );
|
| 49 |
|
|
@@ -52,8 +57,10 @@ add_filter( 'plugin_row_meta', 'ratb_meta_links', 10, 2 );
|
|
| 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 |
|
|
@@ -62,8 +69,10 @@ add_action( 'init', 'ratb_load_textdomain' );
|
|
| 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 |
|
|
@@ -71,7 +80,9 @@ function ratb_uninstall() {
|
|
| 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 |
|
|
@@ -80,6 +91,7 @@ register_activation_hook( __FILE__, 'ratb_activation' );
|
|
| 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
|
|
@@ -91,6 +103,7 @@ function ratb_admin_init(){
|
|
| 91 |
'writing', // settings page
|
| 92 |
'default' // settings section
|
| 93 |
);
|
|
|
|
| 94 |
}
|
| 95 |
add_action('admin_init', 'ratb_admin_init');
|
| 96 |
|
|
@@ -114,6 +127,7 @@ function ratb_setting_input() {
|
|
| 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 |
}
|
|
@@ -138,9 +152,13 @@ function ratb_buttons_lines_tiny_mce(){
|
|
| 138 |
add_filter( 'mce_buttons', 'ratb_tiny_mce_buttons_rearrange', 5 );
|
| 139 |
add_filter( 'mce_buttons_2', 'ratb_tiny_mce_buttons_2_rearrange', 5 );
|
| 140 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 141 |
}
|
| 142 |
//Else, do nothing... use the default editor style
|
| 143 |
-
|
| 144 |
}
|
| 145 |
add_action( 'admin_head', 'ratb_buttons_lines_tiny_mce', 5 );
|
| 146 |
|
|
@@ -149,6 +167,7 @@ add_action( 'admin_head', 'ratb_buttons_lines_tiny_mce', 5 );
|
|
| 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.
|
|
@@ -168,6 +187,7 @@ function ratb_tiny_mce_buttons( $buttons_array ){
|
|
| 168 |
'dfw' // Distraction-free mode on/off.
|
| 169 |
);
|
| 170 |
return $mce_buttons;
|
|
|
|
| 171 |
}
|
| 172 |
|
| 173 |
|
|
@@ -175,6 +195,7 @@ function ratb_tiny_mce_buttons( $buttons_array ){
|
|
| 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.
|
|
@@ -189,15 +210,23 @@ function ratb_tiny_mce_buttons_2( $buttons_array ){
|
|
| 189 |
'redo', // Redoes the last undoed operation.
|
| 190 |
'wp_help' // Opens the help.
|
| 191 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
return $mce_buttons_2;
|
|
|
|
| 193 |
}
|
| 194 |
|
| 195 |
|
| 196 |
/***************************************************************
|
| 197 |
-
*
|
| 198 |
***************************************************************/
|
| 199 |
-
function
|
| 200 |
-
|
|
|
|
| 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.
|
|
@@ -216,16 +245,14 @@ function ratb_tiny_mce_buttons_rearrange( $buttons_array ){
|
|
| 216 |
'spellchecker', // ???
|
| 217 |
'wp_adv', // Toggles the second toolbar on/off.
|
| 218 |
'dfw' // Distraction-free mode on/off.
|
| 219 |
-
);
|
| 220 |
-
|
| 221 |
}
|
| 222 |
|
| 223 |
|
| 224 |
-
|
| 225 |
-
|
| 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.
|
|
@@ -236,6 +263,62 @@ function ratb_tiny_mce_buttons_2_rearrange( $buttons_array ){
|
|
| 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 |
}
|
| 1 |
<?php
|
| 2 |
/*
|
| 3 |
* Plugin Name: Re-add text underline and justify
|
| 4 |
+
* Plugin URI: https://www.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.3
|
| 8 |
+
* Author URI: https://www.b-website.com/
|
| 9 |
* Domain Path: /langs
|
| 10 |
* Text Domain: re-add-underline-justify
|
| 11 |
*/
|
| 31 |
* SECURITY : Exit if accessed directly
|
| 32 |
***************************************************************/
|
| 33 |
if ( !defined( 'ABSPATH' ) ) {
|
| 34 |
+
|
| 35 |
die( 'Direct access not allowed!' );
|
| 36 |
+
|
| 37 |
}
|
| 38 |
|
| 39 |
|
| 41 |
* Add custom meta link on plugin list page
|
| 42 |
***************************************************************/
|
| 43 |
function ratb_meta_links( $links, $file ) {
|
| 44 |
+
|
| 45 |
if ( $file === 're-add-underline-justify/re-add-underline-justify.php' ) {
|
| 46 |
+
$paypalDonate = 'https:// www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=7Z6YVM63739Y8';
|
| 47 |
$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>';
|
| 48 |
+
$links[] = '<a href="' . $paypalDonate . '" target="_blank" title="' . __( 'Donate to this plugin »' ) . '"><strong>' . __( 'Donate to this plugin »' ) . '</strong></a>';
|
| 49 |
}
|
| 50 |
return $links;
|
| 51 |
+
|
| 52 |
}
|
| 53 |
add_filter( 'plugin_row_meta', 'ratb_meta_links', 10, 2 );
|
| 54 |
|
| 57 |
* Load plugin textdomain
|
| 58 |
***************************************************************/
|
| 59 |
function ratb_load_textdomain() {
|
| 60 |
+
|
| 61 |
$path = dirname( plugin_basename( __FILE__ ) ) . '/langs/';
|
| 62 |
load_plugin_textdomain( 're-add-underline-justify', FALSE, $path );
|
| 63 |
+
|
| 64 |
}
|
| 65 |
add_action( 'init', 'ratb_load_textdomain' );
|
| 66 |
|
| 69 |
* Remove plugin settings from DB on plugin deletion
|
| 70 |
***************************************************************/
|
| 71 |
function ratb_uninstall() {
|
| 72 |
+
|
| 73 |
// Remove option from DB
|
| 74 |
delete_option( 'ratb_options' );
|
| 75 |
+
|
| 76 |
}
|
| 77 |
|
| 78 |
|
| 80 |
* Hooks for install & uninstall
|
| 81 |
***************************************************************/
|
| 82 |
function ratb_activation() {
|
| 83 |
+
|
| 84 |
register_uninstall_hook( __FILE__, 'ratb_uninstall' );
|
| 85 |
+
|
| 86 |
}
|
| 87 |
register_activation_hook( __FILE__, 'ratb_activation' );
|
| 88 |
|
| 91 |
* Register the new setting on the Wrinting screen
|
| 92 |
***************************************************************/
|
| 93 |
function ratb_admin_init(){
|
| 94 |
+
|
| 95 |
register_setting(
|
| 96 |
'writing', // settings page
|
| 97 |
'ratb_options' // option name
|
| 103 |
'writing', // settings page
|
| 104 |
'default' // settings section
|
| 105 |
);
|
| 106 |
+
|
| 107 |
}
|
| 108 |
add_action('admin_init', 'ratb_admin_init');
|
| 109 |
|
| 127 |
<option value="1"' . selected( $options['ratb_mce_style'], 1, false ) . '>' . __( 'Default - without underline & justify buttons', 're-add-underline-justify' ) . '</option>
|
| 128 |
<option value="2"' . selected( $options['ratb_mce_style'], 2, false ) . '>' . __( 'Re-add underline & justify buttons', 're-add-underline-justify' ) . '</option>
|
| 129 |
<option value="3"' . selected( $options['ratb_mce_style'], 3, false ) . '>' . __( 'Re-add underline & justify + rearrange', 're-add-underline-justify' ) . '</option>
|
| 130 |
+
<option value="4"' . selected( $options['ratb_mce_style'], 4, false ) . '>' . __( 'Re-add justify only', 're-add-underline-justify' ) . '</option>
|
| 131 |
</select>';
|
| 132 |
|
| 133 |
}
|
| 152 |
add_filter( 'mce_buttons', 'ratb_tiny_mce_buttons_rearrange', 5 );
|
| 153 |
add_filter( 'mce_buttons_2', 'ratb_tiny_mce_buttons_2_rearrange', 5 );
|
| 154 |
|
| 155 |
+
} else if ( isset( $options['ratb_mce_style'] ) && $options['ratb_mce_style'] == 4 ) {
|
| 156 |
+
|
| 157 |
+
add_filter( 'mce_buttons', 'ratb_tiny_mce_buttons_justify', 5 );
|
| 158 |
+
|
| 159 |
}
|
| 160 |
//Else, do nothing... use the default editor style
|
| 161 |
+
|
| 162 |
}
|
| 163 |
add_action( 'admin_head', 'ratb_buttons_lines_tiny_mce', 5 );
|
| 164 |
|
| 167 |
* First editor row buttons - 4.6
|
| 168 |
***************************************************************/
|
| 169 |
function ratb_tiny_mce_buttons( $buttons_array ){
|
| 170 |
+
|
| 171 |
$mce_buttons = array(
|
| 172 |
'bold', // Applies the bold format to the current selection.
|
| 173 |
'italic', // Applies the italic format to the current selection.
|
| 187 |
'dfw' // Distraction-free mode on/off.
|
| 188 |
);
|
| 189 |
return $mce_buttons;
|
| 190 |
+
|
| 191 |
}
|
| 192 |
|
| 193 |
|
| 195 |
* Second editor row buttons - 4.6
|
| 196 |
***************************************************************/
|
| 197 |
function ratb_tiny_mce_buttons_2( $buttons_array ){
|
| 198 |
+
|
| 199 |
$mce_buttons_2 = array(
|
| 200 |
'formatselect', // Dropdown list with block formats to apply to selection.
|
| 201 |
'underline', // Applies the underline format to the current selection.
|
| 210 |
'redo', // Redoes the last undoed operation.
|
| 211 |
'wp_help' // Opens the help.
|
| 212 |
);
|
| 213 |
+
|
| 214 |
+
//Fix for ACF code button
|
| 215 |
+
if ( in_array( 'code', $buttons_array ) ){
|
| 216 |
+
$mce_buttons_2[] = 'code';
|
| 217 |
+
}
|
| 218 |
+
|
| 219 |
return $mce_buttons_2;
|
| 220 |
+
|
| 221 |
}
|
| 222 |
|
| 223 |
|
| 224 |
/***************************************************************
|
| 225 |
+
* Buttons lists - 4.7 + rearrange
|
| 226 |
***************************************************************/
|
| 227 |
+
function ratb_tiny_mce_buttons_rearrange_list(){
|
| 228 |
+
|
| 229 |
+
return $mce_buttons = array(
|
| 230 |
'formatselect', // Dropdown list with block formats to apply to selection.
|
| 231 |
'bold', // Applies the bold format to the current selection.
|
| 232 |
'italic', // Applies the italic format to the current selection.
|
| 245 |
'spellchecker', // ???
|
| 246 |
'wp_adv', // Toggles the second toolbar on/off.
|
| 247 |
'dfw' // Distraction-free mode on/off.
|
| 248 |
+
);
|
| 249 |
+
|
| 250 |
}
|
| 251 |
|
| 252 |
|
| 253 |
+
function ratb_tiny_mce_buttons_2_rearrange_list(){
|
| 254 |
+
|
| 255 |
+
return $mce_buttons_2 = array(
|
|
|
|
|
|
|
| 256 |
'strikethrough', // Applies strike though format to the current selection.
|
| 257 |
'forecolor', // Applies foreground/text color to selection.
|
| 258 |
'pastetext', // Toggles plain text pasting mode on/off.
|
| 263 |
'undo', // Undoes the last operation.
|
| 264 |
'redo', // Redoes the last undoed operation.
|
| 265 |
'wp_help' // Opens the help.
|
| 266 |
+
);
|
| 267 |
+
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
|
| 271 |
+
/***************************************************************
|
| 272 |
+
* First editor row buttons - 4.7 + rearrange
|
| 273 |
+
***************************************************************/
|
| 274 |
+
function ratb_tiny_mce_buttons_rearrange( $buttons_array ){
|
| 275 |
+
|
| 276 |
+
$mce_buttons = ratb_tiny_mce_buttons_rearrange_list();
|
| 277 |
+
|
| 278 |
+
//Keep extra buttons by comparing two buttons lines
|
| 279 |
+
$mce_buttons_2 = ratb_tiny_mce_buttons_2_rearrange_list();
|
| 280 |
+
foreach( $buttons_array as $button ){
|
| 281 |
+
if( !in_array( $button, $mce_buttons ) && !in_array( $button, $mce_buttons_2 ) ){
|
| 282 |
+
array_push( $mce_buttons, $button );
|
| 283 |
+
}
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
return $mce_buttons;
|
| 287 |
+
|
| 288 |
+
}
|
| 289 |
+
|
| 290 |
+
|
| 291 |
+
/***************************************************************
|
| 292 |
+
* Second editor row buttons - 4.7 + rearrange
|
| 293 |
+
***************************************************************/
|
| 294 |
+
function ratb_tiny_mce_buttons_2_rearrange( $buttons_array ){
|
| 295 |
+
|
| 296 |
+
$mce_buttons_2 = ratb_tiny_mce_buttons_2_rearrange_list();
|
| 297 |
+
|
| 298 |
+
//Keep extra buttons by comparing two buttons lines
|
| 299 |
+
$mce_buttons = ratb_tiny_mce_buttons_rearrange_list();
|
| 300 |
+
foreach( $buttons_array as $button ){
|
| 301 |
+
if( !in_array( $button, $mce_buttons_2 ) && !in_array( $button, $mce_buttons ) ){
|
| 302 |
+
array_push( $mce_buttons_2, $button );
|
| 303 |
+
}
|
| 304 |
+
}
|
| 305 |
+
|
| 306 |
return $mce_buttons_2;
|
| 307 |
+
|
| 308 |
+
}
|
| 309 |
+
|
| 310 |
+
|
| 311 |
+
/***************************************************************
|
| 312 |
+
* First editor row buttons - Re-add justify only
|
| 313 |
+
***************************************************************/
|
| 314 |
+
function ratb_tiny_mce_buttons_justify( $buttons_array ){
|
| 315 |
+
|
| 316 |
+
if ( !in_array( 'alignjustify', $buttons_array ) && in_array( 'alignright', $buttons_array ) ){
|
| 317 |
+
$key = array_search( 'alignright', $buttons_array );
|
| 318 |
+
$inserted = array( 'alignjustify' );
|
| 319 |
+
array_splice( $buttons_array, $key + 1, 0, $inserted );
|
| 320 |
+
}
|
| 321 |
+
|
| 322 |
+
return $buttons_array;
|
| 323 |
+
|
| 324 |
}
|
readme.txt
CHANGED
|
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
| 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 |
|
|
@@ -18,18 +18,21 @@ If you don't want to change the way you edit your content and/or don't want to c
|
|
| 18 |
|
| 19 |
**You may change the Editor style from the Writing option page.**
|
| 20 |
|
| 21 |
-
|
| 22 |
|
| 23 |
* Default - without underline & justify buttons
|
| 24 |
* Re-add underline & justify buttons
|
| 25 |
* Re-add underline & justify + rearrange
|
|
|
|
| 26 |
|
| 27 |
-
|
| 28 |
|
|
|
|
| 29 |
|
| 30 |
-
[DOCUMENTATION](http://b-website.com/re-add-text-underline-and-justify "Plugin documentation")
|
| 31 |
|
| 32 |
-
[
|
|
|
|
|
|
|
| 33 |
|
| 34 |
|
| 35 |
**Please ask for help or report bugs if anything goes wrong. It is the best way to make the community benefit!**
|
|
@@ -53,13 +56,18 @@ Just go to Settings -> Writing and select the option you want under "Editor styl
|
|
| 53 |
2. Default - without underline & justify buttons
|
| 54 |
3. Re-add underline & justify buttons
|
| 55 |
4. Re-add underline & justify + rearrange
|
|
|
|
| 56 |
|
| 57 |
|
| 58 |
== Changelog ==
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
= 0.1.2 - 11/14/2016 =
|
| 61 |
* Change mce button hook priority to prevent errors with other plugins adding extra buttons
|
| 62 |
-
* readme.txt update
|
| 63 |
|
| 64 |
= 0.1.1 - 11/10/2016 =
|
| 65 |
* Fix an issue hidding Editor content.
|
|
@@ -70,4 +78,7 @@ Just go to Settings -> Writing and select the option you want under "Editor styl
|
|
| 70 |
== Upgrade Notice ==
|
| 71 |
|
| 72 |
= 0.1 =
|
| 73 |
-
* First release.
|
|
|
|
|
|
|
|
|
| 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.3
|
| 8 |
License: GPLv2 or later
|
| 9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
| 10 |
|
| 18 |
|
| 19 |
**You may change the Editor style from the Writing option page.**
|
| 20 |
|
| 21 |
+
4 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 |
+
* Re-add justify only (added in 0.1.3)
|
| 27 |
|
| 28 |
+
Please note, the third option is, in my opinion, a good compromise between the 4.6 and 4.7 editor versions. It moves up the style select to the first line and moves the underline button after the other text position buttons.
|
| 29 |
|
| 30 |
+
**IMPORTANT:** Try different options before posting a bug repport. Some plugins like ACF (free version) are using there own list of buttons and can create conflict with this plugin. Option 3 and 4 are best to prevent this plugin from removing your existing buttons.
|
| 31 |
|
|
|
|
| 32 |
|
| 33 |
+
[DOCUMENTATION](https://www.b-website.com/re-add-text-underline-and-justify "Plugin documentation")
|
| 34 |
+
|
| 35 |
+
[CHECK OUT MY OTHER PLUGINS](https://www.b-website.com/category/plugins-en "More plugins by b*web")
|
| 36 |
|
| 37 |
|
| 38 |
**Please ask for help or report bugs if anything goes wrong. It is the best way to make the community benefit!**
|
| 56 |
2. Default - without underline & justify buttons
|
| 57 |
3. Re-add underline & justify buttons
|
| 58 |
4. Re-add underline & justify + rearrange
|
| 59 |
+
5. Re-add justify only
|
| 60 |
|
| 61 |
|
| 62 |
== Changelog ==
|
| 63 |
|
| 64 |
+
= 0.1.3 - 01/14/2016 =
|
| 65 |
+
* Added the fourth option to only re-add justify button (push methode)
|
| 66 |
+
* Push non standard button to the end of the buttons lines for the third option. This prevent from removing extra buttons added by other plugins.
|
| 67 |
+
* Fix for ACF (free) on the second option
|
| 68 |
+
|
| 69 |
= 0.1.2 - 11/14/2016 =
|
| 70 |
* Change mce button hook priority to prevent errors with other plugins adding extra buttons
|
|
|
|
| 71 |
|
| 72 |
= 0.1.1 - 11/10/2016 =
|
| 73 |
* Fix an issue hidding Editor content.
|
| 78 |
== Upgrade Notice ==
|
| 79 |
|
| 80 |
= 0.1 =
|
| 81 |
+
* First release.
|
| 82 |
+
|
| 83 |
+
= 0.1.3 =
|
| 84 |
+
* You now have a fourth option available to only re-add the justify button.
|
