Advanced Excerpt - Version 4.3.7

Version Description

( July 10th, 2020 ) = * New - Option to link the whole excerpt to the single post page * Fix - Issue with "sentence finish" when there is a number with decimal points * Fix - Updated POT file for translations

Download this release

Release Info

Developer wpkube
Plugin Icon wp plugin Advanced Excerpt
Version 4.3.7
Comparing to
See all releases

Code changes from version 4.3.6 to 4.3.7

advanced-excerpt.php CHANGED
@@ -3,12 +3,12 @@
3
  Plugin Name: Advanced Excerpt
4
  Plugin URI: http://wordpress.org/plugins/advanced-excerpt/
5
  Description: Control the appearance of WordPress post excerpts
6
- Version: 4.3.6
7
  Author: WPKube
8
  Author URI: https://wpkube.com
9
  */
10
 
11
- $GLOBALS['advanced_excerpt_version'] = '4.3.6';
12
 
13
  function advanced_excerpt_load_textdomain() {
14
  load_plugin_textdomain( 'advanced-excerpt', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
3
  Plugin Name: Advanced Excerpt
4
  Plugin URI: http://wordpress.org/plugins/advanced-excerpt/
5
  Description: Control the appearance of WordPress post excerpts
6
+ Version: 4.3.7
7
  Author: WPKube
8
  Author URI: https://wpkube.com
9
  */
10
 
11
+ $GLOBALS['advanced_excerpt_version'] = '4.3.7';
12
 
13
  function advanced_excerpt_load_textdomain() {
14
  load_plugin_textdomain( 'advanced-excerpt', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
class/advanced-excerpt.php CHANGED
@@ -11,6 +11,7 @@ class Advanced_Excerpt {
11
  'length' => 40,
12
  'length_type' => 'words',
13
  'no_custom' => 1,
 
14
  'no_shortcode' => 1,
15
  'finish' => 'exact',
16
  'ellipsis' => '…',
@@ -319,6 +320,10 @@ class Advanced_Excerpt {
319
  }
320
  }
321
 
 
 
 
 
322
  return apply_filters( 'advanced_excerpt_content', $text );
323
 
324
  }
@@ -336,7 +341,8 @@ class Advanced_Excerpt {
336
  break;
337
  }
338
  if ( $t[0] != '<' ) { // Token is not a tag
339
- if ( $w >= $length && 'sentence' == $finish && preg_match( '/[\?\.\!].*$/uS', $t ) == 1 ) { // Limit reached, continue until ? . or ! occur at the end
 
340
  $out .= trim( $t );
341
  break;
342
  }
@@ -417,7 +423,7 @@ class Advanced_Excerpt {
417
  $_POST = stripslashes_deep( $_POST );
418
  $this->options['length'] = (int) $_POST['length'];
419
 
420
- $checkbox_options = array( 'no_custom', 'no_shortcode', 'add_link', 'link_new_tab', 'link_screen_reader', 'link_exclude_length', 'the_excerpt', 'the_content', 'the_content_no_break' );
421
 
422
  foreach ( $checkbox_options as $checkbox_option ) {
423
  $this->options[$checkbox_option] = ( isset( $_POST[$checkbox_option] ) ) ? 1 : 0;
11
  'length' => 40,
12
  'length_type' => 'words',
13
  'no_custom' => 1,
14
+ 'link_excerpt' => 0,
15
  'no_shortcode' => 1,
16
  'finish' => 'exact',
17
  'ellipsis' => '&hellip;',
320
  }
321
  }
322
 
323
+ if ( $link_excerpt ) {
324
+ $text = '<a href="' . get_permalink( $post ) . '">' . $text . '</a>';
325
+ }
326
+
327
  return apply_filters( 'advanced_excerpt_content', $text );
328
 
329
  }
341
  break;
342
  }
343
  if ( $t[0] != '<' ) { // Token is not a tag
344
+ $t_trimmed = trim( $t );
345
+ if ( $w >= $length && 'sentence' == $finish && preg_match( '/[\?\.\!](?!\d).*$/uS', $t_trimmed ) == 1 ) { // Limit reached, continue until ? . or ! occur at the end
346
  $out .= trim( $t );
347
  break;
348
  }
423
  $_POST = stripslashes_deep( $_POST );
424
  $this->options['length'] = (int) $_POST['length'];
425
 
426
+ $checkbox_options = array( 'no_custom', 'no_shortcode', 'add_link', 'link_new_tab', 'link_screen_reader', 'link_exclude_length', 'the_excerpt', 'the_content', 'the_content_no_break', 'link_excerpt' );
427
 
428
  foreach ( $checkbox_options as $checkbox_option ) {
429
  $this->options[$checkbox_option] = ( isset( $_POST[$checkbox_option] ) ) ? 1 : 0;
languages/advanced-excerpt.pot CHANGED
@@ -1,59 +1,64 @@
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Advanced Excerpt\n"
4
- "POT-Creation-Date: 2014-05-27 14:13+1000\n"
5
- "PO-Revision-Date: 2014-05-27 14:14+1000\n"
6
  "Last-Translator: WPKube <noreply@wpkube.com>\n"
7
  "Language-Team: WPKube <noreply@wpkube.com>\n"
8
- "Language: en\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "X-Generator: Poedit 1.6.5\n"
13
  "X-Poedit-Basepath: ..\n"
14
  "X-Poedit-SourceCharset: UTF-8\n"
15
  "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
16
  "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
17
  "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
18
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
  "X-Poedit-SearchPath-0: .\n"
20
 
21
- #: class/advanced-excerpt.php:180 template/options.php:2
22
  msgid "Advanced Excerpt Options"
23
  msgstr ""
24
 
25
- #: class/advanced-excerpt.php:180
26
  msgid "Excerpt"
27
  msgstr ""
28
 
29
- #: class/advanced-excerpt.php:201
30
  msgid "Settings"
31
  msgstr ""
32
 
33
- #: class/advanced-excerpt.php:374
34
  msgid "Home Page"
35
  msgstr ""
36
 
37
- #: class/advanced-excerpt.php:375
38
  msgid "Posts RSS Feed"
39
  msgstr ""
40
 
41
- #: class/advanced-excerpt.php:376
42
  msgid "Search Archive"
43
  msgstr ""
44
 
45
- #: class/advanced-excerpt.php:377
46
  msgid "Author Archive"
47
  msgstr ""
48
 
49
- #: class/advanced-excerpt.php:378
50
  msgid "Category Archive"
51
  msgstr ""
52
 
53
- #: class/advanced-excerpt.php:379
54
  msgid "Tag Archive"
55
  msgstr ""
56
 
 
 
 
 
57
  #: template/options.php:4
58
  msgid "Options saved."
59
  msgstr ""
@@ -91,55 +96,85 @@ msgstr ""
91
  msgid "Exact"
92
  msgstr ""
93
 
94
- #: template/options.php:54
 
 
 
 
95
  msgid "Word"
96
  msgstr ""
97
 
98
- #: template/options.php:58
99
  msgid "Sentence"
100
  msgstr ""
101
 
102
- #: template/options.php:62
103
  msgid ""
104
  "Prevents cutting a word or sentence at the end of an excerpt. This option "
105
  "can result in (slightly) longer excerpts."
106
  msgstr ""
107
 
108
- #: template/options.php:67
109
  msgid "Read More Link:"
110
  msgstr ""
111
 
112
- #: template/options.php:72
113
  msgid "Add read more link to excerpt"
114
  msgstr ""
115
 
116
- #: template/options.php:80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  msgid "No Custom Excerpts:"
118
  msgstr ""
119
 
120
- #: template/options.php:86
121
  msgid "Generate excerpts even if a post has a custom excerpt attached."
122
  msgstr ""
123
 
124
- #: template/options.php:93
 
 
 
 
 
 
 
 
 
 
125
  msgid "Strip Shortcodes:"
126
  msgstr ""
127
 
128
- #: template/options.php:99
129
  msgid "Remove shortcodes from the excerpt. <em>(recommended)</em>"
130
  msgstr ""
131
 
132
- #: template/options.php:105
133
  msgid "Filter:"
134
  msgstr ""
135
 
136
- #: template/options.php:122
137
  msgid ""
138
  "Only filter <span class='monospaced'>the_content()</span> when there's no "
139
  "break (&lt;!--more--&gt;) tag in the post content"
140
  msgstr ""
141
 
142
- #: template/options.php:128
143
  msgid ""
144
  "Themes may use <code>the_excerpt()</code> for some pages (e.g. search "
145
  "results) and <code>the_content()</code> on others (e.g. blog archives). "
@@ -147,43 +182,43 @@ msgid ""
147
  "may need to adjust these settings."
148
  msgstr ""
149
 
150
- #: template/options.php:134
151
  msgid "Disable On:"
152
  msgstr ""
153
 
154
- #: template/options.php:148
155
  msgid "Disables excerpt filtering for certain page types."
156
  msgstr ""
157
 
158
- #: template/options.php:154
159
  msgid "Strip Tags:"
160
  msgstr ""
161
 
162
- #: template/options.php:163
163
  msgid "Don't remove any tags"
164
  msgstr ""
165
 
166
- #: template/options.php:167
167
  msgid "Remove all tags except the following"
168
  msgstr ""
169
 
170
- #: template/options.php:197
171
  msgid "Select all"
172
  msgstr ""
173
 
174
- #: template/options.php:197
175
  msgid "Select none"
176
  msgstr ""
177
 
178
- #: template/options.php:198
179
  msgid "More tags"
180
  msgstr ""
181
 
182
- #: template/options.php:205
183
  msgid "Add tag"
184
  msgstr ""
185
 
186
- #: template/options.php:211
187
  msgid "Save Changes"
188
  msgstr ""
189
 
@@ -192,43 +227,33 @@ msgid "Maintained by"
192
  msgstr ""
193
 
194
  #: template/sidebar.php:10
195
- msgid "Profile"
196
  msgstr ""
197
 
198
- #: template/sidebar.php:12
199
- msgid "Donate"
200
  msgstr ""
201
 
202
- #: template/sidebar.php:18
203
- msgid "WordPress Development and Deployment Strategy"
204
  msgstr ""
205
 
206
- #: template/sidebar.php:23
207
- msgid ""
208
- "<strong>Free pro tips</strong> on advanced WordPress development techniques "
209
- "and deployment strategies."
210
  msgstr ""
211
 
212
- #: template/sidebar.php:27
213
- msgid "Your Name"
214
  msgstr ""
215
 
216
- #: template/sidebar.php:31
217
- msgid "Your Email"
218
  msgstr ""
219
 
220
- #: template/sidebar.php:35
221
- msgid "Subscribe"
222
  msgstr ""
223
 
224
- #: template/sidebar.php:39
225
- msgid ""
226
- "I promise I will not use your email for anything else and you can "
227
- "unsubscribe with <span style=\"white-space: nowrap;\">1-click anytime</span>."
228
- msgstr ""
229
-
230
- #: template/sidebar.php:45
231
- msgid ""
232
- "WP Migrate DB Pro &mdash; Push and pull your database from one WordPress "
233
- "install to another in 1-click."
234
  msgstr ""
1
+ #, fuzzy
2
  msgid ""
3
  msgstr ""
4
  "Project-Id-Version: Advanced Excerpt\n"
5
+ "POT-Creation-Date: 2020-07-10 10:26+0000\n"
6
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
7
  "Last-Translator: WPKube <noreply@wpkube.com>\n"
8
  "Language-Team: WPKube <noreply@wpkube.com>\n"
9
+ "Language: \n"
10
  "MIME-Version: 1.0\n"
11
  "Content-Type: text/plain; charset=UTF-8\n"
12
  "Content-Transfer-Encoding: 8bit\n"
13
+ "X-Generator: Loco https://localise.biz/\n"
14
  "X-Poedit-Basepath: ..\n"
15
  "X-Poedit-SourceCharset: UTF-8\n"
16
  "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
17
  "esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
18
  "_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
19
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
20
  "X-Poedit-SearchPath-0: .\n"
21
 
22
+ #: class/advanced-excerpt.php:204 template/options.php:2
23
  msgid "Advanced Excerpt Options"
24
  msgstr ""
25
 
26
+ #: class/advanced-excerpt.php:204
27
  msgid "Excerpt"
28
  msgstr ""
29
 
30
+ #: class/advanced-excerpt.php:225
31
  msgid "Settings"
32
  msgstr ""
33
 
34
+ #: class/advanced-excerpt.php:458
35
  msgid "Home Page"
36
  msgstr ""
37
 
38
+ #: class/advanced-excerpt.php:459
39
  msgid "Posts RSS Feed"
40
  msgstr ""
41
 
42
+ #: class/advanced-excerpt.php:460
43
  msgid "Search Archive"
44
  msgstr ""
45
 
46
+ #: class/advanced-excerpt.php:461
47
  msgid "Author Archive"
48
  msgstr ""
49
 
50
+ #: class/advanced-excerpt.php:462
51
  msgid "Category Archive"
52
  msgstr ""
53
 
54
+ #: class/advanced-excerpt.php:463
55
  msgid "Tag Archive"
56
  msgstr ""
57
 
58
+ #: class/advanced-excerpt.php:464
59
+ msgid "WooCommerce Products"
60
+ msgstr ""
61
+
62
  #: template/options.php:4
63
  msgid "Options saved."
64
  msgstr ""
96
  msgid "Exact"
97
  msgstr ""
98
 
99
+ #: template/options.php:53
100
+ msgid "Exact <small>(count spaces as well)</small>"
101
+ msgstr ""
102
+
103
+ #: template/options.php:57
104
  msgid "Word"
105
  msgstr ""
106
 
107
+ #: template/options.php:61
108
  msgid "Sentence"
109
  msgstr ""
110
 
111
+ #: template/options.php:65
112
  msgid ""
113
  "Prevents cutting a word or sentence at the end of an excerpt. This option "
114
  "can result in (slightly) longer excerpts."
115
  msgstr ""
116
 
117
+ #: template/options.php:70
118
  msgid "Read More Link:"
119
  msgstr ""
120
 
121
+ #: template/options.php:76
122
  msgid "Add read more link to excerpt"
123
  msgstr ""
124
 
125
+ #: template/options.php:85
126
+ msgid "Open read more link in new tab"
127
+ msgstr ""
128
+
129
+ #: template/options.php:91
130
+ msgid "Screen readers compatibility"
131
+ msgstr ""
132
+
133
+ #: template/options.php:91
134
+ msgid "(appends post title with class .screen-reader-text to the link)"
135
+ msgstr ""
136
+
137
+ #: template/options.php:97
138
+ msgid "Remove link if the whole post content shown"
139
+ msgstr ""
140
+
141
+ #: template/options.php:107
142
  msgid "No Custom Excerpts:"
143
  msgstr ""
144
 
145
+ #: template/options.php:113
146
  msgid "Generate excerpts even if a post has a custom excerpt attached."
147
  msgstr ""
148
 
149
+ #: template/options.php:120
150
+ msgid "Link Whole Excerpt:"
151
+ msgstr ""
152
+
153
+ #: template/options.php:126
154
+ msgid ""
155
+ "Makes the whole excerpt be a link to the post. If this is enabled it's "
156
+ "advised to turn on the Strip Tags option."
157
+ msgstr ""
158
+
159
+ #: template/options.php:133
160
  msgid "Strip Shortcodes:"
161
  msgstr ""
162
 
163
+ #: template/options.php:139
164
  msgid "Remove shortcodes from the excerpt. <em>(recommended)</em>"
165
  msgstr ""
166
 
167
+ #: template/options.php:145
168
  msgid "Filter:"
169
  msgstr ""
170
 
171
+ #: template/options.php:162
172
  msgid ""
173
  "Only filter <span class='monospaced'>the_content()</span> when there's no "
174
  "break (&lt;!--more--&gt;) tag in the post content"
175
  msgstr ""
176
 
177
+ #: template/options.php:168
178
  msgid ""
179
  "Themes may use <code>the_excerpt()</code> for some pages (e.g. search "
180
  "results) and <code>the_content()</code> on others (e.g. blog archives). "
182
  "may need to adjust these settings."
183
  msgstr ""
184
 
185
+ #: template/options.php:174
186
  msgid "Disable On:"
187
  msgstr ""
188
 
189
+ #: template/options.php:188
190
  msgid "Disables excerpt filtering for certain page types."
191
  msgstr ""
192
 
193
+ #: template/options.php:194
194
  msgid "Strip Tags:"
195
  msgstr ""
196
 
197
+ #: template/options.php:203
198
  msgid "Don't remove any tags"
199
  msgstr ""
200
 
201
+ #: template/options.php:207
202
  msgid "Remove all tags except the following"
203
  msgstr ""
204
 
205
+ #: template/options.php:237
206
  msgid "Select all"
207
  msgstr ""
208
 
209
+ #: template/options.php:237
210
  msgid "Select none"
211
  msgstr ""
212
 
213
+ #: template/options.php:238
214
  msgid "More tags"
215
  msgstr ""
216
 
217
+ #: template/options.php:245
218
  msgid "Add tag"
219
  msgstr ""
220
 
221
+ #: template/options.php:251
222
  msgid "Save Changes"
223
  msgstr ""
224
 
227
  msgstr ""
228
 
229
  #: template/sidebar.php:10
230
+ msgid "Website"
231
  msgstr ""
232
 
233
+ #: template/sidebar.php:16
234
+ msgid "WordPress Themes, Plugins, Reviews, & Tutorials"
235
  msgstr ""
236
 
237
+ #: template/sidebar.php:19
238
+ msgid "Get awesome content delivered straight to your inbox."
239
  msgstr ""
240
 
241
+ #. Name of the plugin
242
+ msgid "Advanced Excerpt"
 
 
243
  msgstr ""
244
 
245
+ #. Description of the plugin
246
+ msgid "Control the appearance of WordPress post excerpts"
247
  msgstr ""
248
 
249
+ #. URI of the plugin
250
+ msgid "http://wordpress.org/plugins/advanced-excerpt/"
251
  msgstr ""
252
 
253
+ #. Author of the plugin
254
+ msgid "WPKube"
255
  msgstr ""
256
 
257
+ #. Author URI of the plugin
258
+ msgid "https://wpkube.com"
 
 
 
 
 
 
 
 
259
  msgstr ""
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: fancythemes, WPKube
3
  Tags: post excerpt, excerpt, post, content, formatting
4
  Requires at least: 3.2
5
- Tested up to: 5.4
6
- Stable tag: 4.3.6
7
  License: GPLv3
8
 
9
  Control the appearance of WordPress post excerpts
@@ -95,6 +95,11 @@ However, you can [start The Loop manually](http://codex.wordpress.org/The_Loop#M
95
  2. An example of an excerpt generated by the plugin
96
 
97
  == Changelog ==
 
 
 
 
 
98
  = 4.3.6 ( June 1st, 2020 ) =
99
  * Fix - Issue with undefined index PHP notice
100
 
2
  Contributors: fancythemes, WPKube
3
  Tags: post excerpt, excerpt, post, content, formatting
4
  Requires at least: 3.2
5
+ Tested up to: 5.6
6
+ Stable tag: 4.3.7
7
  License: GPLv3
8
 
9
  Control the appearance of WordPress post excerpts
95
  2. An example of an excerpt generated by the plugin
96
 
97
  == Changelog ==
98
+ = 4.3.7 ( July 10th, 2020 ) =
99
+ * New - Option to link the whole excerpt to the single post page
100
+ * Fix - Issue with "sentence finish" when there is a number with decimal points
101
+ * Fix - Updated POT file for translations
102
+
103
  = 4.3.6 ( June 1st, 2020 ) =
104
  * Fix - Issue with undefined index PHP notice
105
 
template/options.php CHANGED
@@ -114,6 +114,19 @@
114
  </label>
115
  </td>
116
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  <tr valign="top">
118
  <th scope="row">
119
  <label for="no-shortcode">
114
  </label>
115
  </td>
116
  </tr>
117
+ <tr valign="top">
118
+ <th scope="row">
119
+ <label for="link-excerpt">
120
+ <?php _e( "Link Whole Excerpt:", 'advanced-excerpt' ); ?>
121
+ </label>
122
+ </th>
123
+ <td>
124
+ <label for="link-excerpt">
125
+ <input name="link_excerpt" type="checkbox" id="link-excerpt" value="on" <?php echo ( 1 == $link_excerpt ) ? 'checked="checked"' : ''; ?> />
126
+ <?php _e( "Makes the whole excerpt be a link to the post. If this is enabled it's advised to turn on the Strip Tags option.", 'advanced-excerpt' ); ?>
127
+ </label>
128
+ </td>
129
+ </tr>
130
  <tr valign="top">
131
  <th scope="row">
132
  <label for="no-shortcode">