Skip to content

Commit

Permalink
[fixup] Fixed script relying on English version of the value when it …
Browse files Browse the repository at this point in the history
…could be translated.
  • Loading branch information
Konrad Karpieszuk committed Jan 11, 2022
1 parent a9d84cf commit cb2da8d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions app/EditorBox/Enqueues.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

class Enqueues {
public function enqueue_editor_stuff() {
wp_enqueue_style( 'editor_box_style', plugins_url( 'css/editor.css', EDITORBOX_PLUGIN_FILE ), [], '1.1.1641749900' ); // date '+%s'
wp_enqueue_script( 'editor_box_script', plugins_url( 'js/editor.js', EDITORBOX_PLUGIN_FILE ), [], '1.1.1641749900' );
wp_enqueue_style( 'editor_box_style', plugins_url( 'css/editor.css', EDITORBOX_PLUGIN_FILE ), [], '1.1.1641886040' ); // date '+%s'
wp_enqueue_script( 'editor_box_script', plugins_url( 'js/editor.js', EDITORBOX_PLUGIN_FILE ), [], '1.1.1641886040' );
wp_localize_script('editor_box_script', 'editor_box_int', [
'ajaxurl' => admin_url('admin-ajax.php'),
'publish_button_value' => __( 'Publish', 'editor_box' ),
Expand Down
2 changes: 1 addition & 1 deletion js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ document.addEventListener('DOMContentLoaded', function () {
}

function flipPublishingMode() {
if ( publish_button.value == 'Save draft' ) {
if ( publish_button.value == editor_box_int.draft_button_value ) {
publish_button.value = editor_box_int.publish_button_value;
mode_field.value = 'publish';
} else {
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,9 @@ Like on Facebook or Twitter, post title is not obligatory to provide. If you sav
* Feature - Post can be saved as draft instead immediate publishing (press Ctrl button over Publish button to switch mode)
* Enhancement - Added assets versioning to help refreshing cached versions between plugin releases
* Enhancement - Use large image size in rendered html instead of full size
* Fix - Fixed issue with not handled image uploads when image size bigger than PHP upload_max_filesize
* Fix - Fixed issue with not handled image uploads when image size bigger than PHP upload_max_filesize

= 1.1.1 =
*Release Date - *

* Fix - Fixed script relying on English version of the value when it could be translated.

0 comments on commit cb2da8d

Please sign in to comment.