Print, PDF, Email by PrintFriendly - Version 3.4.1

Version Description

  • Improved page content selection options
Download this release

Release Info

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

Code changes from version 3.4.0 to 3.4.1

Files changed (4) hide show
  1. languages/printfriendly.pot +126 -87
  2. pf.php +33 -20
  3. readme.txt +5 -2
  4. screenshot-1.png +0 -0
languages/printfriendly.pot CHANGED
@@ -4,313 +4,352 @@ msgid ""
4
  msgstr ""
5
  "Project-Id-Version: PrintFriendly\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/printfriendly\n"
7
- "POT-Creation-Date: 2013-03-29 21:36+0100\n"
8
- "PO-Revision-Date: 2013-03-29 21:36+0100\n"
9
  "Last-Translator: EJ Reinders Folmer <poedit_nospam@adviesenzo.nl>\n"
10
- "Language-Team: \n"
 
11
  "MIME-Version: 1.0\n"
12
  "Content-Type: text/plain; charset=UTF-8\n"
13
  "Content-Transfer-Encoding: 8bit\n"
14
- "X-Generator: Poedit 1.5.5\n"
15
  "X-Poedit-KeywordsList: __;_e;_n;_x;_ex;_nx;esc_html__;esc_html_e;esc_html_x;"
16
  "esc_attr__;esc_attr_e;esc_attr_x;_n_noop;_nx_noop\n"
17
  "X-Poedit-Basepath: .\n"
 
18
  "X-Poedit-SearchPath-0: .\n"
19
  "X-Poedit-SearchPath-1: ..\n"
20
 
21
- #: ../pf.php:381
22
  msgid ""
23
  "No valid custom image url received, please enter a valid url to use a custom "
24
  "image."
25
  msgstr ""
26
 
27
- #: ../pf.php:390
28
  msgid "The text size you entered is invalid, please stay between 9px and 25px"
29
  msgstr ""
30
 
31
- #: ../pf.php:398
32
  msgid ""
33
  "The color you entered is not valid, it must be a valid hexadecimal RGB font "
34
  "color."
35
  msgstr ""
36
 
37
- #: ../pf.php:478
38
  msgid ""
39
  "No valid custom logo url received, please enter a valid url to use a custom "
40
  "logo."
41
  msgstr ""
42
 
43
- #: ../pf.php:524
44
  msgid "PrintFriendly Options"
45
  msgstr ""
46
 
47
- #: ../pf.php:524
48
  msgid "Print Friendly & PDF"
49
  msgstr ""
50
 
51
- #: ../pf.php:537
52
  msgid "Need Help?"
53
  msgstr ""
54
 
55
- #: ../pf.php:538
56
  #, php-format
57
  msgid "Be sure to check out the %s!"
58
  msgstr ""
59
 
60
- #: ../pf.php:538
61
  msgid "Frequently Asked Questions"
62
  msgstr ""
63
 
64
- #: ../pf.php:577
65
  msgid "Settings"
66
  msgstr ""
67
 
68
- #: ../pf.php:973
69
  msgid "Only display when post is in:"
70
  msgstr ""
71
 
72
- #: ../pf.php:996
 
 
 
 
 
 
 
 
 
73
  msgid "Print Friendly & PDF Settings"
74
  msgstr ""
75
 
76
- #: ../pf.php:1001
77
  msgid "Pick Your Button Style"
78
  msgstr ""
79
 
80
- #: ../pf.php:1024
81
  msgid "Custom Button"
82
  msgstr ""
83
 
84
- #: ../pf.php:1027
85
  msgid "Enter Image URL"
86
  msgstr ""
87
 
88
- #: ../pf.php:1029
89
- msgid "Ex: http://www.example.com/<br>Ex: /wp/wp-content/uploads/example.png)"
90
  msgstr ""
91
 
92
- #: ../pf.php:1035
93
  msgid "Text"
94
  msgstr ""
95
 
96
- #: ../pf.php:1039
97
  msgid "Text Color"
98
  msgstr ""
99
 
100
- #: ../pf.php:1046
101
  msgid "Text Size"
102
  msgstr ""
103
 
104
- #: ../pf.php:1058
105
  msgid "Button Positioning"
106
  msgstr ""
107
 
108
- #: ../pf.php:1065
109
  msgid "Left Align"
110
  msgstr ""
111
 
112
- #: ../pf.php:1066
113
  msgid "Right Align"
114
  msgstr ""
115
 
116
- #: ../pf.php:1067
117
  msgid "Center"
118
  msgstr ""
119
 
120
- #: ../pf.php:1068
121
  msgid "None"
122
  msgstr ""
123
 
124
- #: ../pf.php:1075
125
  msgid "Above Content"
126
  msgstr ""
127
 
128
- #: ../pf.php:1076
129
  msgid "Below Content"
130
  msgstr ""
131
 
132
- #: ../pf.php:1083
133
  msgid "Margin Left"
134
  msgstr ""
135
 
136
- #: ../pf.php:1086
137
  msgid "Margin Right"
138
  msgstr ""
139
 
140
- #: ../pf.php:1089
141
  msgid "Margin Top"
142
  msgstr ""
143
 
144
- #: ../pf.php:1092
145
  msgid "Margin Bottom"
146
  msgstr ""
147
 
148
- #: ../pf.php:1101
149
  msgid "Display button on:"
150
  msgstr ""
151
 
152
- #: ../pf.php:1103
153
  msgid "Posts"
154
  msgstr ""
155
 
156
- #: ../pf.php:1104
157
  msgid "Pages"
158
  msgstr ""
159
 
160
- #: ../pf.php:1105
161
  msgid "Homepage"
162
  msgstr ""
163
 
164
- #: ../pf.php:1106
165
  msgid "Category Pages"
166
  msgstr ""
167
 
168
- #: ../pf.php:1107
169
  msgid "Taxonomy Pages"
170
  msgstr ""
171
 
172
- #: ../pf.php:1108
173
  msgid "Add direct to template"
174
  msgstr ""
175
 
176
- #: ../pf.php:1110
177
  msgid "or use shortcode inside your page/article"
178
  msgstr ""
179
 
180
- #: ../pf.php:1128
181
  msgid "Print PDF Options"
182
  msgstr ""
183
 
184
- #: ../pf.php:1130
185
  msgid "Page header"
186
  msgstr ""
187
 
188
- #: ../pf.php:1132
189
  msgid "My Website Icon"
190
  msgstr ""
191
 
192
- #: ../pf.php:1133
193
  msgid "Upload an Image"
194
  msgstr ""
195
 
196
- #: ../pf.php:1137
197
- msgid "Enter url"
198
- msgstr ""
199
-
200
- #: ../pf.php:1138
201
- msgid "Text (optional)"
202
- msgstr ""
203
-
204
- #: ../pf.php:1143
205
  msgid "Click-to-delete"
206
  msgstr ""
207
 
208
- #: ../pf.php:1145 ../pf.php:1168 ../pf.php:1175 ../pf.php:1182
209
  msgid "Allow"
210
  msgstr ""
211
 
212
- #: ../pf.php:1146 ../pf.php:1169 ../pf.php:1176 ../pf.php:1183
213
  msgid "Not Allow"
214
  msgstr ""
215
 
216
- #: ../pf.php:1150
217
  msgid "Images"
218
  msgstr ""
219
 
220
- #: ../pf.php:1152
221
  msgid "Include"
222
  msgstr ""
223
 
224
- #: ../pf.php:1153
225
  msgid "Exclude"
226
  msgstr ""
227
 
228
- #: ../pf.php:1157
229
  msgid "Image style"
230
  msgstr ""
231
 
232
- #: ../pf.php:1159
233
  msgid "Align Right"
234
  msgstr ""
235
 
236
- #: ../pf.php:1160
237
  msgid "Align Left"
238
  msgstr ""
239
 
240
- #: ../pf.php:1161
241
  msgid "Align None"
242
  msgstr ""
243
 
244
- #: ../pf.php:1162
245
  msgid "Center/Block"
246
  msgstr ""
247
 
248
- #: ../pf.php:1166
249
  msgid "Email"
250
  msgstr ""
251
 
252
- #: ../pf.php:1173
253
  msgid "PDF"
254
  msgstr ""
255
 
256
- #: ../pf.php:1180
257
  msgid "Print"
258
  msgstr ""
259
 
260
- #: ../pf.php:1187
261
  msgid "Custom css url"
262
  msgstr ""
263
 
264
- #: ../pf.php:1189
265
  msgid "?"
266
  msgstr ""
267
 
268
- #: ../pf.php:1194
269
  msgid "Webmaster Settings"
270
  msgstr ""
271
 
272
- #: ../pf.php:1198
 
 
 
 
273
  msgid "http (common)"
274
  msgstr ""
275
 
276
- #: ../pf.php:1199
277
  msgid "https (secure)"
278
  msgstr ""
279
 
280
- #: ../pf.php:1206 ../pf.php:1213
 
 
 
 
281
  msgid "No"
282
  msgstr ""
283
 
284
- #: ../pf.php:1207 ../pf.php:1212
285
  msgid "Yes"
286
  msgstr ""
287
 
288
- #: ../pf.php:1216
289
- msgid ""
290
- "Display print preview on-page using a JavaScript Lightbox (user never leaves "
291
- "the site/page)."
292
  msgstr ""
293
 
294
- #: ../pf.php:1219
295
- msgid "Display print preview on PrintFriendly.com (No JavaScript)"
296
  msgstr ""
297
 
298
- #: ../pf.php:1224
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  msgid "Save Options"
300
  msgstr ""
301
 
302
- #: ../pf.php:1225
303
  msgid "Cancel"
304
  msgstr ""
305
 
306
- #: ../pf.php:1230
 
 
 
 
 
 
307
  msgid "Like PrintFriendly?"
308
  msgstr ""
309
 
310
- #: ../pf.php:1230
311
  msgid "Give us a rating"
312
  msgstr ""
313
 
314
- #: ../pf.php:1230
315
  msgid "Need help or have suggestions?"
316
  msgstr ""
4
  msgstr ""
5
  "Project-Id-Version: PrintFriendly\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/printfriendly\n"
7
+ "POT-Creation-Date: 2015-06-17 20:37+0530\n"
8
+ "PO-Revision-Date: 2015-06-17 20:38+0530\n"
9
  "Last-Translator: EJ Reinders Folmer <poedit_nospam@adviesenzo.nl>\n"
10
+ "Language-Team: PrintFriendly Team <support@printfriendly>\n"
11
+ "Language: en_US\n"
12
  "MIME-Version: 1.0\n"
13
  "Content-Type: text/plain; charset=UTF-8\n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
+ "X-Generator: Poedit 1.5.4\n"
16
  "X-Poedit-KeywordsList: __;_e;_n;_x;_ex;_nx;esc_html__;esc_html_e;esc_html_x;"
17
  "esc_attr__;esc_attr_e;esc_attr_x;_n_noop;_nx_noop\n"
18
  "X-Poedit-Basepath: .\n"
19
+ "X-Poedit-SourceCharset: UTF-8\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
  "X-Poedit-SearchPath-1: ..\n"
22
 
23
+ #: ../pf.php:492
24
  msgid ""
25
  "No valid custom image url received, please enter a valid url to use a custom "
26
  "image."
27
  msgstr ""
28
 
29
+ #: ../pf.php:501
30
  msgid "The text size you entered is invalid, please stay between 9px and 25px"
31
  msgstr ""
32
 
33
+ #: ../pf.php:509
34
  msgid ""
35
  "The color you entered is not valid, it must be a valid hexadecimal RGB font "
36
  "color."
37
  msgstr ""
38
 
39
+ #: ../pf.php:589
40
  msgid ""
41
  "No valid custom logo url received, please enter a valid url to use a custom "
42
  "logo."
43
  msgstr ""
44
 
45
+ #: ../pf.php:642
46
  msgid "PrintFriendly Options"
47
  msgstr ""
48
 
49
+ #: ../pf.php:642
50
  msgid "Print Friendly & PDF"
51
  msgstr ""
52
 
53
+ #: ../pf.php:655
54
  msgid "Need Help?"
55
  msgstr ""
56
 
57
+ #: ../pf.php:656
58
  #, php-format
59
  msgid "Be sure to check out the %s!"
60
  msgstr ""
61
 
62
+ #: ../pf.php:656
63
  msgid "Frequently Asked Questions"
64
  msgstr ""
65
 
66
+ #: ../pf.php:695
67
  msgid "Settings"
68
  msgstr ""
69
 
70
+ #: ../pf.php:1112
71
  msgid "Only display when post is in:"
72
  msgstr ""
73
 
74
+ #: ../pf.php:1130
75
+ msgid ""
76
+ "Currently in Debug Mode. Following information is visible in debug mode only:"
77
+ msgstr ""
78
+
79
+ #: ../pf.php:1131
80
+ msgid "Options:"
81
+ msgstr ""
82
+
83
+ #: ../pf.php:1137
84
  msgid "Print Friendly & PDF Settings"
85
  msgstr ""
86
 
87
+ #: ../pf.php:1142
88
  msgid "Pick Your Button Style"
89
  msgstr ""
90
 
91
+ #: ../pf.php:1165
92
  msgid "Custom Button"
93
  msgstr ""
94
 
95
+ #: ../pf.php:1168
96
  msgid "Enter Image URL"
97
  msgstr ""
98
 
99
+ #: ../pf.php:1170
100
+ msgid "Ex: http://www.example.com/<br>Ex: /wp/wp-content/uploads/example.png"
101
  msgstr ""
102
 
103
+ #: ../pf.php:1176
104
  msgid "Text"
105
  msgstr ""
106
 
107
+ #: ../pf.php:1180
108
  msgid "Text Color"
109
  msgstr ""
110
 
111
+ #: ../pf.php:1187
112
  msgid "Text Size"
113
  msgstr ""
114
 
115
+ #: ../pf.php:1199
116
  msgid "Button Positioning"
117
  msgstr ""
118
 
119
+ #: ../pf.php:1206
120
  msgid "Left Align"
121
  msgstr ""
122
 
123
+ #: ../pf.php:1207
124
  msgid "Right Align"
125
  msgstr ""
126
 
127
+ #: ../pf.php:1208
128
  msgid "Center"
129
  msgstr ""
130
 
131
+ #: ../pf.php:1209
132
  msgid "None"
133
  msgstr ""
134
 
135
+ #: ../pf.php:1216
136
  msgid "Above Content"
137
  msgstr ""
138
 
139
+ #: ../pf.php:1217
140
  msgid "Below Content"
141
  msgstr ""
142
 
143
+ #: ../pf.php:1224
144
  msgid "Margin Left"
145
  msgstr ""
146
 
147
+ #: ../pf.php:1227
148
  msgid "Margin Right"
149
  msgstr ""
150
 
151
+ #: ../pf.php:1230
152
  msgid "Margin Top"
153
  msgstr ""
154
 
155
+ #: ../pf.php:1233
156
  msgid "Margin Bottom"
157
  msgstr ""
158
 
159
+ #: ../pf.php:1242
160
  msgid "Display button on:"
161
  msgstr ""
162
 
163
+ #: ../pf.php:1244
164
  msgid "Posts"
165
  msgstr ""
166
 
167
+ #: ../pf.php:1245
168
  msgid "Pages"
169
  msgstr ""
170
 
171
+ #: ../pf.php:1246
172
  msgid "Homepage"
173
  msgstr ""
174
 
175
+ #: ../pf.php:1247
176
  msgid "Category Pages"
177
  msgstr ""
178
 
179
+ #: ../pf.php:1248
180
  msgid "Taxonomy Pages"
181
  msgstr ""
182
 
183
+ #: ../pf.php:1249
184
  msgid "Add direct to template"
185
  msgstr ""
186
 
187
+ #: ../pf.php:1251
188
  msgid "or use shortcode inside your page/article"
189
  msgstr ""
190
 
191
+ #: ../pf.php:1269
192
  msgid "Print PDF Options"
193
  msgstr ""
194
 
195
+ #: ../pf.php:1271
196
  msgid "Page header"
197
  msgstr ""
198
 
199
+ #: ../pf.php:1273
200
  msgid "My Website Icon"
201
  msgstr ""
202
 
203
+ #: ../pf.php:1274
204
  msgid "Upload an Image"
205
  msgstr ""
206
 
207
+ #: ../pf.php:1285
 
 
 
 
 
 
 
 
208
  msgid "Click-to-delete"
209
  msgstr ""
210
 
211
+ #: ../pf.php:1287 ../pf.php:1310 ../pf.php:1317 ../pf.php:1324
212
  msgid "Allow"
213
  msgstr ""
214
 
215
+ #: ../pf.php:1288 ../pf.php:1311 ../pf.php:1318 ../pf.php:1325
216
  msgid "Not Allow"
217
  msgstr ""
218
 
219
+ #: ../pf.php:1292
220
  msgid "Images"
221
  msgstr ""
222
 
223
+ #: ../pf.php:1294
224
  msgid "Include"
225
  msgstr ""
226
 
227
+ #: ../pf.php:1295
228
  msgid "Exclude"
229
  msgstr ""
230
 
231
+ #: ../pf.php:1299
232
  msgid "Image style"
233
  msgstr ""
234
 
235
+ #: ../pf.php:1301
236
  msgid "Align Right"
237
  msgstr ""
238
 
239
+ #: ../pf.php:1302
240
  msgid "Align Left"
241
  msgstr ""
242
 
243
+ #: ../pf.php:1303
244
  msgid "Align None"
245
  msgstr ""
246
 
247
+ #: ../pf.php:1304
248
  msgid "Center/Block"
249
  msgstr ""
250
 
251
+ #: ../pf.php:1308
252
  msgid "Email"
253
  msgstr ""
254
 
255
+ #: ../pf.php:1315
256
  msgid "PDF"
257
  msgstr ""
258
 
259
+ #: ../pf.php:1322
260
  msgid "Print"
261
  msgstr ""
262
 
263
+ #: ../pf.php:1329
264
  msgid "Custom css url"
265
  msgstr ""
266
 
267
+ #: ../pf.php:1331
268
  msgid "?"
269
  msgstr ""
270
 
271
+ #: ../pf.php:1336
272
  msgid "Webmaster Settings"
273
  msgstr ""
274
 
275
+ #: ../pf.php:1338
276
+ msgid "Website Protocol"
277
+ msgstr ""
278
+
279
+ #: ../pf.php:1340
280
  msgid "http (common)"
281
  msgstr ""
282
 
283
+ #: ../pf.php:1341
284
  msgid "https (secure)"
285
  msgstr ""
286
 
287
+ #: ../pf.php:1346
288
+ msgid "Password Protected Content"
289
+ msgstr ""
290
+
291
+ #: ../pf.php:1348 ../pf.php:1355 ../pf.php:1367
292
  msgid "No"
293
  msgstr ""
294
 
295
+ #: ../pf.php:1349 ../pf.php:1354 ../pf.php:1366
296
  msgid "Yes"
297
  msgstr ""
298
 
299
+ #: ../pf.php:1352
300
+ msgid "Use JavaScript"
 
 
301
  msgstr ""
302
 
303
+ #: ../pf.php:1358
304
+ msgid "Preview appears on the page in a Lightbox."
305
  msgstr ""
306
 
307
+ #: ../pf.php:1361
308
+ msgid "Preview opens a new browser tab."
309
+ msgstr ""
310
+
311
+ #: ../pf.php:1364
312
+ msgid "Track in Google Analytics"
313
+ msgstr ""
314
+
315
+ #: ../pf.php:1371
316
+ msgid "My Page Content Selected By:"
317
+ msgstr ""
318
+
319
+ #: ../pf.php:1371
320
+ msgid "Change this setting if your content is not showing in the preview."
321
+ msgstr ""
322
+
323
+ #: ../pf.php:1373
324
+ msgid "WP \"the_content\" filter"
325
+ msgstr ""
326
+
327
+ #: ../pf.php:1374
328
+ msgid "Content Algorithm"
329
+ msgstr ""
330
+
331
+ #: ../pf.php:1379
332
  msgid "Save Options"
333
  msgstr ""
334
 
335
+ #: ../pf.php:1380
336
  msgid "Cancel"
337
  msgstr ""
338
 
339
+ #: ../pf.php:1383
340
+ msgid ""
341
+ "Need professional options for your corporate, education, or agency developed "
342
+ "website? Check out"
343
+ msgstr ""
344
+
345
+ #: ../pf.php:1385
346
  msgid "Like PrintFriendly?"
347
  msgstr ""
348
 
349
+ #: ../pf.php:1385
350
  msgid "Give us a rating"
351
  msgstr ""
352
 
353
+ #: ../pf.php:1385
354
  msgid "Need help or have suggestions?"
355
  msgstr ""
pf.php CHANGED
@@ -5,11 +5,12 @@ Plugin Name: Print Friendly and PDF
5
  Plugin URI: http://www.printfriendly.com
6
  Description: PrintFriendly & PDF button for your website. Optimizes your pages and brand for print, pdf, and email.
7
  Name and URL are included to ensure repeat visitors and new visitors when printed versions are shared.
8
- Version: 3.4.0
9
  Author: Print Friendly
10
  Author URI: http://www.PrintFriendly.com
11
 
12
  Changelog :
 
13
  3.4.0 - Fixed the admin javascript error and increased plugin text boxes size
14
  3.3.10 - Implemented both Classic Google Analytics and Google Universal Analytics code.
15
  3.3.9 - Removed the functionality that opens new window when JavaScript is disabled.
@@ -138,9 +139,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
138
  add_filter( 'the_excerpt', array( &$this, 'show_link' ) );
139
  }
140
 
141
- if($this->use_wp_content_hook()) {
142
- add_action('the_content', array(&$this, 'add_pf_content_class_around_content_hook'));
143
- }
144
 
145
  if ( is_admin() ) {
146
  // Hook into init for registration of the option and the language files
@@ -162,14 +161,21 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
162
 
163
 
164
  /**
165
- * Returns true if WP content hooks are to used to find content
166
- * @since 3.2.8
167
  *
168
  **/
169
- function use_wp_content_hook() {
170
- return (isset($this->options['pf_algo']) && $this->options['pf_algo'] == 'wp');
 
 
 
 
 
 
 
171
  }
172
-
173
  /**
174
  * Adds wraps content in pf-content class to help Printfriendly algo determine the content
175
  *
@@ -177,12 +183,13 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
177
  *
178
  **/
179
  function add_pf_content_class_around_content_hook($content = false) {
180
- if($content && !$this->print_only_override($content)) {
 
181
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ));
182
  return '<div class="pf-content">'.$content.'</div>';
183
- }
184
- else
185
  return $content;
 
186
  }
187
 
188
  /**
@@ -290,7 +297,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
290
 
291
  ?>
292
  <script type="text/javascript">
293
-
294
  var pfHeaderImgUrl = '<?php echo esc_js(esc_url_raw($image_url)); ?>';
295
  var pfHeaderTagline = '<?php echo esc_js($tagline); ?>';
296
  var pfdisableClickToDel = '<?php echo esc_js($this->options['click_to_delete']); ?>';
@@ -325,9 +332,12 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
325
  */
326
  function show_link( $content = false ) {
327
  $is_manual = $this->is_manual();
 
328
  if( !$content && !$is_manual )
329
  return "";
330
 
 
 
331
 
332
  $button = $this->getButton();
333
  if ( $is_manual )
@@ -623,7 +633,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
623
  $valid_input['enable_google_analytics'] = "no";
624
  }
625
 
626
- if ( !isset( $input['pf_algo'] ) || !in_array( $input['pf_algo'], array( 'wp', 'pf' ) ) ) {
627
  $valid_input['pf_algo'] = "wp";
628
  }
629
 
@@ -1167,7 +1177,7 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1167
  <div id="custom-img">
1168
  <?php _e( "Enter Image URL", $this->hook ); ?><br>
1169
  <input id="custom_image" type="text" class="clear regular-text" size="30" name="<?php echo $this->option_name; ?>[custom_image]" value="<?php $this->val( 'custom_image' ); ?>" />
1170
- <div class="description"><?php _e( "Ex: http://www.example.com/<br>Ex: /wp/wp-content/uploads/example.png)", $this->hook ); ?>
1171
  </div>
1172
  </div>
1173
  <div id="pf-custom-button-error"></div>
@@ -1312,13 +1322,16 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1312
  </select>
1313
  </label>
1314
  <label for="pdf">
1315
- <?php _e( "PDF", $this->hook ); ?>
1316
- <select name="<?php echo $this->option_name; ?>[pdf]" id="pdf">
1317
  <option value="0" <?php selected( $this->options['pdf'], '0' ); ?>><?php _e( "Allow", $this->hook ); ?></option>
1318
  <option value="1" <?php selected( $this->options['pdf'], '1' ); ?>><?php _e( "Not Allow", $this->hook ); ?></option>
1319
  </select>
 
 
 
1320
  </label>
1321
- <label for="print">
1322
  <?php _e( "Print", $this->hook ); ?>
1323
  <select name="<?php echo $this->option_name; ?>[print]" id="print">
1324
  <option value="0" <?php selected( $this->options['print'], '0' ); ?>><?php _e( "Allow", $this->hook ); ?></option>
@@ -1370,8 +1383,8 @@ if ( ! class_exists( 'PrintFriendly_WordPress' ) ) {
1370
 
1371
  <label for="pf-algo-usage"><?php _e( 'My Page Content Selected By:', $this->hook ); ?> <span class="description no-italics" ><?php _e( 'Change this setting if your content is not showing in the preview.', $this->hook ); ?></span><br>
1372
  <select id="pf-algo-usage" name="<?php echo $this->option_name; ?>[pf_algo]">
1373
- <option value="wp" <?php $this->selected( 'pf_algo', 'wp' ); ?>> <?php _e( 'WP "the_content" filter
1374
- ', $this->hook ); ?></option>
1375
  <option value="pf" <?php $this->selected( 'pf_algo', 'pf' ); ?>> <?php _e( "Content Algorithm", $this->hook ); ?></option>
1376
  </select>
1377
  </label>
5
  Plugin URI: http://www.printfriendly.com
6
  Description: PrintFriendly & PDF button for your website. Optimizes your pages and brand for print, pdf, and email.
7
  Name and URL are included to ensure repeat visitors and new visitors when printed versions are shared.
8
+ Version: 3.4.1
9
  Author: Print Friendly
10
  Author URI: http://www.PrintFriendly.com
11
 
12
  Changelog :
13
+ 3.4.1 - Improved page content selection options
14
  3.4.0 - Fixed the admin javascript error and increased plugin text boxes size
15
  3.3.10 - Implemented both Classic Google Analytics and Google Universal Analytics code.
16
  3.3.9 - Removed the functionality that opens new window when JavaScript is disabled.
139
  add_filter( 'the_excerpt', array( &$this, 'show_link' ) );
140
  }
141
 
142
+ add_action('the_content', array(&$this, 'add_pf_content_class_around_content_hook'));
 
 
143
 
144
  if ( is_admin() ) {
145
  // Hook into init for registration of the option and the language files
161
 
162
 
163
  /**
164
+ * Returns true if the content displayed by main WP query
165
+ * @since 3.4.1
166
  *
167
  **/
168
+ function is_main_query_loop(){
169
+ $is_main_query_loop = false;
170
+ foreach ($GLOBALS['wp_the_query']->posts as $query_post) {
171
+ if($query_post->ID == get_the_ID() ){
172
+ $is_main_query_loop = true;
173
+ break;
174
+ }
175
+ }
176
+ return $is_main_query_loop;
177
  }
178
+
179
  /**
180
  * Adds wraps content in pf-content class to help Printfriendly algo determine the content
181
  *
183
  *
184
  **/
185
  function add_pf_content_class_around_content_hook($content = false) {
186
+
187
+ if( isset($this->options['pf_algo']) && $content && in_array( $this->options['pf_algo'], array('wp', 'ws')) && !$this->print_only_override($content) && $this->options['pf_algo'] != 'ws' && $this->is_main_query_loop() ) {
188
  add_action( 'wp_footer', array( &$this, 'print_script_footer' ));
189
  return '<div class="pf-content">'.$content.'</div>';
190
+ } else {
 
191
  return $content;
192
+ }
193
  }
194
 
195
  /**
297
 
298
  ?>
299
  <script type="text/javascript">
300
+
301
  var pfHeaderImgUrl = '<?php echo esc_js(esc_url_raw($image_url)); ?>';
302
  var pfHeaderTagline = '<?php echo esc_js($tagline); ?>';
303
  var pfdisableClickToDel = '<?php echo esc_js($this->options['click_to_delete']); ?>';
332
  */
333
  function show_link( $content = false ) {
334
  $is_manual = $this->is_manual();
335
+
336
  if( !$content && !$is_manual )
337
  return "";
338
 
339
+ if( $this->options['pf_algo'] == 'ws' && !$this->is_main_query_loop() )
340
+ return $content;
341
 
342
  $button = $this->getButton();
343
  if ( $is_manual )
633
  $valid_input['enable_google_analytics'] = "no";
634
  }
635
 
636
+ if ( !isset( $input['pf_algo'] ) || !in_array( $input['pf_algo'], array( 'wp', 'ws', 'pf' ) ) ) {
637
  $valid_input['pf_algo'] = "wp";
638
  }
639
 
1177
  <div id="custom-img">
1178
  <?php _e( "Enter Image URL", $this->hook ); ?><br>
1179
  <input id="custom_image" type="text" class="clear regular-text" size="30" name="<?php echo $this->option_name; ?>[custom_image]" value="<?php $this->val( 'custom_image' ); ?>" />
1180
+ <div class="description"><?php _e( "Ex: http://www.example.com/<br>Ex: /wp/wp-content/uploads/example.png", $this->hook ); ?>
1181
  </div>
1182
  </div>
1183
  <div id="pf-custom-button-error"></div>
1322
  </select>
1323
  </label>
1324
  <label for="pdf">
1325
+ <span class="alignleft"><?php _e( "PDF", $this->hook ); ?></span>
1326
+ <select name="<?php echo $this->option_name; ?>[pdf]" id="pdf" class="alignleft clear">
1327
  <option value="0" <?php selected( $this->options['pdf'], '0' ); ?>><?php _e( "Allow", $this->hook ); ?></option>
1328
  <option value="1" <?php selected( $this->options['pdf'], '1' ); ?>><?php _e( "Not Allow", $this->hook ); ?></option>
1329
  </select>
1330
+ <p class="alignleft">
1331
+ <h4 class="alignleft notice"><abbr class="required"><?php _e( "Developer Note: ", $this->hook ); ?></abbr><?php _e( "On localhost the images can not be included in the PDF. Once the website is live/public images will be included in the PDF.", $this->hook ); ?></h4>
1332
+ </p>
1333
  </label>
1334
+ <label for="print" class="clear">
1335
  <?php _e( "Print", $this->hook ); ?>
1336
  <select name="<?php echo $this->option_name; ?>[print]" id="print">
1337
  <option value="0" <?php selected( $this->options['print'], '0' ); ?>><?php _e( "Allow", $this->hook ); ?></option>
1383
 
1384
  <label for="pf-algo-usage"><?php _e( 'My Page Content Selected By:', $this->hook ); ?> <span class="description no-italics" ><?php _e( 'Change this setting if your content is not showing in the preview.', $this->hook ); ?></span><br>
1385
  <select id="pf-algo-usage" name="<?php echo $this->option_name; ?>[pf_algo]">
1386
+ <option value="wp" <?php $this->selected( 'pf_algo', 'wp' ); ?>> <?php _e( 'Wordpress Universal', $this->hook ); ?></option>
1387
+ <option value="ws" <?php $this->selected( 'pf_algo', 'ws' ); ?>> <?php _e( "Wordpress Standard/Strict", $this->hook ); ?></option>
1388
  <option value="pf" <?php $this->selected( 'pf_algo', 'pf' ); ?>> <?php _e( "Content Algorithm", $this->hook ); ?></option>
1389
  </select>
1390
  </label>
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: printfriendly,joostdevalk, jrf
3
  Tags: print, pdf, printer, printing, printable, widget, plugin
4
  Requires at least: 2.8
5
- Tested up to: 4.2.2
6
- Stable tag: 3.4.0
7
 
8
 
9
  The #1 Print and PDF button for your WordPress site. Printer Friendly pages without coding, css, or print.css. Fast, easy, and professional.
@@ -140,6 +140,9 @@ If you have any other issues with the plugin or the PrintFriendly widget, please
140
 
141
  == Changelog ==
142
 
 
 
 
143
  = 3.4.0 =
144
  * Fixed the admin javascript error and increased plugin text boxes size
145
  * Enabled Print Friendly button href to www.printfriendly.com only when the plugin JavaScript option is enabled
2
  Contributors: printfriendly,joostdevalk, jrf
3
  Tags: print, pdf, printer, printing, printable, widget, plugin
4
  Requires at least: 2.8
5
+ Tested up to: 4.3
6
+ Stable tag: 3.4.1
7
 
8
 
9
  The #1 Print and PDF button for your WordPress site. Printer Friendly pages without coding, css, or print.css. Fast, easy, and professional.
140
 
141
  == Changelog ==
142
 
143
+ = 3.4.1 =
144
+ * Improved page content selection options
145
+
146
  = 3.4.0 =
147
  * Fixed the admin javascript error and increased plugin text boxes size
148
  * Enabled Print Friendly button href to www.printfriendly.com only when the plugin JavaScript option is enabled
screenshot-1.png CHANGED
Binary file