Skip to content

Commit

Permalink
version 2.1.5a
Browse files Browse the repository at this point in the history
  • Loading branch information
baden03 committed Mar 1, 2022
1 parent fbf1358 commit 001840c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Print-O-Matic
* Donate link: https://pluginoven.com/panares-fund/
* Tags: print, print element, print shortcode, send to print, print button, print me, jQuery, print page, javascript, twinpictures, plugin oven
* Requires at least: 4.9
* Tested up to: 5.9
* Stable tag: 2.1.4
* Tested up to: 5.9.2
* Stable tag: 2.1.5a
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down
10 changes: 6 additions & 4 deletions print-o-matic.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Text Domain: print-o-matic
Plugin URI: https://pluginoven.com/plugins/print-o-matic/
Description: Shortcode that adds a printer icon, allowing the user to print the post or a specified HTML element in the post.
Version: 2.1.4
Version: 2.1.5a
Author: twinpictures
Author URI: https://twinpictures.de
License: GPL2
Expand All @@ -17,7 +17,7 @@
*/
class WP_Print_O_Matic {

var $version = '2.1.4';
var $version = '2.1.5a';
var $domain = 'printomat';
var $options_name = 'WP_Print_O_Matic_options';
var $options = array(
Expand Down Expand Up @@ -75,7 +75,8 @@ function printMaticInit() {
'pom_do_not_print' => $this->options['do_not_print'],
'pom_pause_time' => $this->options['pause_time'],
];
wp_add_inline_script( 'printomatic-js', 'const print_data = ' . json_encode( $print_data ), 'before' );
//wp_add_inline_script( 'printomatic-js', 'const print_data = ' . json_encode( $print_data ), 'before' );
wp_localize_script( 'printomatic-js', 'print_data', $print_data);

//css
wp_register_style( 'printomatic-css', plugins_url('/css/style.css', __FILE__) , array (), '2.0' );
Expand Down Expand Up @@ -199,7 +200,8 @@ function shortcode($atts, $content = null){
$print_data['pom_pause_time'] = $pause_before_print;
}
if(!empty($print_data)){
wp_add_inline_script( 'printomatic-js', 'const print_data_'.$id.' = ' . json_encode( $print_data ) );
//wp_add_inline_script( 'printomatic-js', 'const print_data_'.$id.' = ' . json_encode( $print_data ) );
wp_localize_script( 'printomatic-js', 'print_data', $print_data);
}

//return nothing if usign an external button
Expand Down
10 changes: 6 additions & 4 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Contributors: twinpictures, baden03
Donate link: https://pluginoven.com/panares-fund/
Tags: print, print element, print shortcode, send to print, print button, print me, jQuery, print page, javascript, twinpictures, plugin oven
Requires at least: 4.9
Tested up to: 5.9
Stable tag: 2.1.4
Tested up to: 5.9.2
Stable tag: 2.1.5a
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -50,6 +50,9 @@ We like to rock the party.

== Changelog ==

= 2.1.5 =
* reverted back to wp_localize_script to pass print data to js script

= 2.1.4 =
* try and force lazy load images to load before print

Expand Down Expand Up @@ -236,5 +239,4 @@ We like to rock the party.
* The plug-in was forked and completely rewritten from Print Button Shortcode by MyWebsiteAdvisor.

== Upgrade Notice ==
* improved method of passing default and print-trigger specific data to js script using wp_add_inline_script
* added line numbers back to CodeMirror, with admin css
* reverted back to wp_localize_script to pass print data to js script

0 comments on commit 001840c

Please sign in to comment.