Print, PDF, Email by PrintFriendly - Version 3.0.3

Version Description

  • Support for bad themes that alter template tags and prevent JavaScript from loading in footer.
Download this release

Release Info

Developer printfriendly
Plugin Icon 128x128 Print, PDF, Email by PrintFriendly
Version 3.0.3
Comparing to
See all releases

Code changes from version 3.0.2 to 3.0.3

Files changed (2) hide show
  1. pf.php +27 -19
  2. readme.txt +6 -1
pf.php CHANGED
@@ -4,11 +4,14 @@ Plugin Name: Print Friendly and PDF
4
  Plugin URI: http://www.printfriendly.com
5
  Description: PrintFriendly & PDF optimizes your pages for print. Help your readers save paper and ink, plus enjoy your content in printed form. Website
6
  Name and URL are included to ensure repeat visitors and new visitors when printed versions are shared.
7
- Version: 3.0.2
8
  Author: Print Friendly
9
  Author URI: http://www.PrintFriendly.com
10
 
11
  Changelog :
 
 
 
12
  3.0 - Complete overhaul of the plugin by Joost de Valk.
13
  2.1.8 - The Print Button was showing up on printed, or PDF, pages. Junk! Print or PDF button no longer displayed on printed out page or PDF.
14
  2.1.7 - Changed button from span to div to support floating.
@@ -30,7 +33,7 @@ Changelog :
30
  * PrintFriendly WordPress plugin. Allows easy embedding of printfriendly.com buttons.
31
  * @package PrintFriendly_WordPress
32
  * @author Joost de Valk <joost@yoast.com>
33
- * @copyright Copyright (C) 2011, Joost de Valk
34
  */
35
  if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
36
 
@@ -170,10 +173,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
170
  if ( !isset( $this->options['javascript_include'] ) || $this->options['javascript_include'] != 'on' )
171
  return;
172
 
173
- if ( 'manual' == $this->options['show_list'] || 'all' == $this->options['show_list'] ||
174
- ( 'single' == $this->options['show_list'] && is_singular() ) ||
175
- ( 'posts' == $this->options['show_list'] && is_single() )
176
- ) {
177
  ?>
178
  <script type="text/javascript">
179
  // PrintFriendly
@@ -182,7 +182,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
182
  document.getElementsByTagName('head')[0].appendChild(e);
183
  </script>
184
  <?php
185
- }
186
  }
187
 
188
  /**
@@ -216,27 +216,35 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
216
 
217
  $button = apply_filters( 'printfriendly_button', '<div class="printfriendly'.$align.'"><a href="'.$href.'" rel="nofollow" '.$onclick.'>'.$this->button().'</a></div>' );
218
 
219
- if ( 'manual' == $this->options['show_list'] ) {
 
220
  // Hook the script call now, so it only get's loaded when needed, and need is determined by the user calling pf_button
221
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ) );
 
 
 
 
222
  return $button;
223
- } else {
224
- if (
225
- is_single() ||
226
- ( is_page() && 'posts' != $this->options['show_list'] ) ||
227
- ( is_home() && 'all' == $this->options['show_list'] )
228
- ) {
229
- // Hook the script call now, so it only get's loaded when needed
230
- add_action( 'wp_footer', array( &$this, 'print_script_footer' ) );
231
-
232
  if ( $this->options['content_placement'] == 'before' )
233
- return $button.$content;
234
  else
235
  return $content.$button;
236
- } else {
 
 
 
237
  return $content;
238
  }
 
239
  }
 
240
  }
241
 
242
  /**
4
  Plugin URI: http://www.printfriendly.com
5
  Description: PrintFriendly & PDF optimizes your pages for print. Help your readers save paper and ink, plus enjoy your content in printed form. Website
6
  Name and URL are included to ensure repeat visitors and new visitors when printed versions are shared.
7
+ Version: 3.0.3
8
  Author: Print Friendly
9
  Author URI: http://www.PrintFriendly.com
10
 
11
  Changelog :
12
+ 3.0.3 - Support for bad themes that alter template tags and prevent JavaScript from loading in footer
13
+ 3.0.2 - Fixed JS bug with Google Chrome not submitting and fixed input validation issues.
14
+ 3.0.1 - Fixed minor JS bug.
15
  3.0 - Complete overhaul of the plugin by Joost de Valk.
16
  2.1.8 - The Print Button was showing up on printed, or PDF, pages. Junk! Print or PDF button no longer displayed on printed out page or PDF.
17
  2.1.7 - Changed button from span to div to support floating.
33
  * PrintFriendly WordPress plugin. Allows easy embedding of printfriendly.com buttons.
34
  * @package PrintFriendly_WordPress
35
  * @author Joost de Valk <joost@yoast.com>
36
+ * @copyright Copyright (C) 2011, PrintFriendly
37
  */
38
  if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
39
 
173
  if ( !isset( $this->options['javascript_include'] ) || $this->options['javascript_include'] != 'on' )
174
  return;
175
 
176
+ else
 
 
 
177
  ?>
178
  <script type="text/javascript">
179
  // PrintFriendly
182
  document.getElementsByTagName('head')[0].appendChild(e);
183
  </script>
184
  <?php
185
+
186
  }
187
 
188
  /**
216
 
217
  $button = apply_filters( 'printfriendly_button', '<div class="printfriendly'.$align.'"><a href="'.$href.'" rel="nofollow" '.$onclick.'>'.$this->button().'</a></div>' );
218
 
219
+ if (is_singular())
220
+ {
221
  // Hook the script call now, so it only get's loaded when needed, and need is determined by the user calling pf_button
222
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ) );
223
+ }
224
+
225
+ if ( 'manual' == $this->options['show_list'] )
226
+ {
227
  return $button;
228
+ }
229
+
230
+ else
231
+ {
232
+ if (is_single() || ( is_page() && 'posts' != $this->options['show_list'] ) || ( is_home() && 'all' == $this->options['show_list'] ))
233
+ {
234
+
 
 
235
  if ( $this->options['content_placement'] == 'before' )
236
+ return $button.$content;
237
  else
238
  return $content.$button;
239
+ }
240
+
241
+ else
242
+ {
243
  return $content;
244
  }
245
+
246
  }
247
+
248
  }
249
 
250
  /**
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: printfriendly,joostdevalk
3
  Tags: print, pdf, printer, printing, printable, widget, plugin
4
  Requires at least: 2.8
5
  Tested up to: 3.2.1
6
- Stable tag: 3.0.2
7
 
8
  The #1 Print and PDF button for your WordPress site. Printer Friendly pages without coding, css, or print.css. Fast, easy, and professional.
9
 
@@ -64,6 +64,11 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
64
 
65
  == Changelog ==
66
 
 
 
 
 
 
67
  = 3.0.2 =
68
 
69
  * Fixed JS bug with Google Chrome not submitting and fixed input validation issues.
3
  Tags: print, pdf, printer, printing, printable, widget, plugin
4
  Requires at least: 2.8
5
  Tested up to: 3.2.1
6
+ Stable tag: 3.0.3
7
 
8
  The #1 Print and PDF button for your WordPress site. Printer Friendly pages without coding, css, or print.css. Fast, easy, and professional.
9
 
64
 
65
  == Changelog ==
66
 
67
+ = 3.0.3 =
68
+
69
+ * Support for bad themes that alter template tags and prevent JavaScript from loading in footer.
70
+
71
+
72
  = 3.0.2 =
73
 
74
  * Fixed JS bug with Google Chrome not submitting and fixed input validation issues.