Post Snippets - Version 1.9.4

Version Description

Download this release

Release Info

Developer artstorm
Plugin Icon 128x128 Post Snippets
Version 1.9.4
Comparing to
See all releases

Code changes from version 1.9.3 to 1.9.4

classes/help.php CHANGED
@@ -146,6 +146,16 @@ class Post_Snippets_Help
146
  '</p>
147
  <p>'.
148
  __( 'If you enclose the shortcode in your posts, you can access the enclosed content by using the variable {content} in your snippet. The {content} variable is reserved, so don\'t use it in the variables field.', 'post-snippets' ).
 
 
 
 
 
 
 
 
 
 
149
  '</p>';
150
  }
151
 
146
  '</p>
147
  <p>'.
148
  __( 'If you enclose the shortcode in your posts, you can access the enclosed content by using the variable {content} in your snippet. The {content} variable is reserved, so don\'t use it in the variables field.', 'post-snippets' ).
149
+ '</p>
150
+
151
+ <h2>'
152
+ . __( 'Options', 'post-snippets' ).
153
+ '</h2>
154
+ <p><strong>PHP</strong><br/>'.
155
+ __( 'See the dedicated help section for information about PHP shortcodes.', 'post-snippets' ).
156
+ '</p>
157
+ <p><strong>wptexturize</strong><br/>'.
158
+ sprintf(__( 'Before the shortcode is outputted, it can optionally be formatted with %s, to transform quotes to smart quotes, apostrophes, dashes, ellipses, the trademark symbol, and the multiplication symbol.', 'post-snippets' ), '<a href="http://codex.wordpress.org/Function_Reference/wptexturize">wptexturize</a>' ).
159
  '</p>';
160
  }
161
 
classes/settings.php CHANGED
@@ -69,13 +69,20 @@ class Post_Snippets_Settings
69
  <input type='text' name='<?php echo $key; ?>_title' value='<?php echo $snippet['title']; ?>' />
70
  </td>
71
  <td class='name'>
72
- <input type='text' name='<?php echo $key; ?>_vars' value='<?php echo $snippet['vars']; ?>' /><br/>
 
 
73
  <?php
74
  $this->checkbox(__('Shortcode', 'post-snippets'), $key.'_shortcode',
75
  $snippet['shortcode']);
76
 
 
 
77
  $this->checkbox(__('PHP Code', 'post-snippets'), $key.'_php',
78
  $snippet['php']);
 
 
 
79
  ?>
80
  </td>
81
  <td class='desc'>
69
  <input type='text' name='<?php echo $key; ?>_title' value='<?php echo $snippet['title']; ?>' />
70
  </td>
71
  <td class='name'>
72
+ <input type='text' name='<?php echo $key; ?>_vars' value='<?php echo $snippet['vars']; ?>' />
73
+ <br/>
74
+ <br/>
75
  <?php
76
  $this->checkbox(__('Shortcode', 'post-snippets'), $key.'_shortcode',
77
  $snippet['shortcode']);
78
 
79
+ echo '<br/><strong>Shortcode Options:</strong><br/>';
80
+
81
  $this->checkbox(__('PHP Code', 'post-snippets'), $key.'_php',
82
  $snippet['php']);
83
+
84
+ $wptexturize = isset( $snippet['wptexturize'] ) ? $snippet['wptexturize'] : false;
85
+ $this->checkbox('wptexturize', $key.'_wptexturize', $wptexturize);
86
  ?>
87
  </td>
88
  <td class='desc'>
languages/post-snippets-sv_SE.mo CHANGED
Binary file
languages/post-snippets-sv_SE.po CHANGED
@@ -6,8 +6,8 @@ msgid ""
6
  msgstr ""
7
  "Project-Id-Version: Post Snippets\n"
8
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/post-snippets\n"
9
- "POT-Creation-Date: 2012-01-22 15:13:10+00:00\n"
10
- "PO-Revision-Date: 2012-01-22 16:38+0100\n"
11
  "Last-Translator: Johan Steen <artstorm@gmail.com>\n"
12
  "Language-Team: <artstorm@gmail.com>\n"
13
  "MIME-Version: 1.0\n"
@@ -46,37 +46,37 @@ msgstr "Variabler"
46
  msgid "Snippet"
47
  msgstr "Snippet"
48
 
49
- #: classes/settings.php:74
50
  #: classes/help.php:46
51
- #: classes/help.php:248
52
  msgid "Shortcode"
53
  msgstr "Shortcode"
54
 
55
- #: classes/settings.php:77
56
  msgid "PHP Code"
57
  msgstr "PHP kod"
58
 
59
- #: classes/settings.php:83
60
  #: classes/help.php:125
61
  msgid "Description"
62
  msgstr "Beskrivning"
63
 
64
- #: classes/settings.php:94
65
  msgid "Update Snippets"
66
  msgstr "Uppdatera snippets"
67
 
68
  #: classes/help.php:41
69
- #: classes/help.php:246
70
  msgid "Basic"
71
  msgstr "Grundläggande"
72
 
73
  #: classes/help.php:51
74
- #: classes/help.php:250
75
  msgid "PHP"
76
  msgstr "PHP"
77
 
78
  #: classes/help.php:56
79
- #: classes/help.php:252
80
  msgid "Advanced"
81
  msgstr "Avancerat"
82
 
@@ -97,12 +97,12 @@ msgid "Give the snippet a title that helps you identify it in the post editor. T
97
  msgstr "Ge snippeten en titel som hjälper till att identifiera den i inläggsredigeraren. Titeln blir också namnet på shortcoden om du aktiverar det valet."
98
 
99
  #: classes/help.php:101
100
- msgid "A comma separated list of custom variables you can reference in your snippet."
101
- msgstr "En kommaseparerad lista av egendefinerade variabler som du kan referera i din snippet."
102
 
103
  #: classes/help.php:104
104
  #: classes/help.php:115
105
- #: classes/help.php:220
106
  msgid "Example"
107
  msgstr "Exempel"
108
 
@@ -134,43 +134,55 @@ msgstr "Titeln på snippeten blir även namnet för att komma åt den som en sho
134
  msgid "If you enclose the shortcode in your posts, you can access the enclosed content by using the variable {content} in your snippet. The {content} variable is reserved, so don't use it in the variables field."
135
  msgstr "Om du innesluter text med shortcoden i dina inlägg, så kan du komma åt det inneslutna innehålet genom att använda variabeln {content} i din snippet. {content} variablen är reserverad, så använd inte det namnet content i variabel fältet."
136
 
137
- #: classes/help.php:161
 
 
 
 
 
 
 
 
 
 
 
 
138
  msgid "Snippets defined as shortcodes can optionally also be evaluated as PHP Code by enabling the PHP checkbox. PHP snippets is only available when treating the snippet as a shortcode."
139
  msgstr "Snippets som är definerade som shortcodes, kan om så önskas bli evaluerade som PHP kod genom att aktivera PHP kryssrutan. PHP snippets fungerar endast när snippet är aktiverad som en shortcode."
140
 
141
- #: classes/help.php:164
142
  msgid "Example PHP Snippet"
143
  msgstr "Exempel PHP Snippet"
144
 
145
- #: classes/help.php:173
146
  msgid "With a snippet defined like the one above, you can call it with its shortcode definition in a post. Let's pretend that the example snippet is named phpcode and have one variable defined loop_me, then it would be called like this from a post:"
147
  msgstr "Med en snippet definerad som den ovan, kan du komma åt den via dess shortcode namn i ett inlägg. Låt oss säga att exempel snippeten har fått namnet phpcode och att den har en variabel definerad loop_me, då skulle man komma åt den från ett inlägg så här:"
148
 
149
- #: classes/help.php:179
150
  msgid "When the shortcode is executed the loop_me variable will be replaced with the string supplied in the shortcode and then the PHP code will be evaluated. (Outputting the string five times in this case. Wow!)"
151
  msgstr "När shortcoden körs kommer loop_me variabeln bli ersatt med strängen som definerad från shortcoden och efter det så evalueras PHP koden. (Skriver strängen 5 gånger i detta fallet. Wow!)"
152
 
153
- #: classes/help.php:182
154
  msgid "Note the evaluation order, any snippet variables will be replaced before the snippet is evaluated as PHP code. Also note that a PHP snippet don't need to be wrapped in &lt;?php #code; ?&gt;."
155
  msgstr "Notera evaluerings ordningen, variabler för snippet kommer ersättas innan snippeten evalueras som PHP kod. Notera också att en PHP snippet inte ska omslutas med &lt;?php #code; ?&gt;."
156
 
157
- #: classes/help.php:195
158
  msgid "You can retrieve a Post Snippet directly from PHP, in a theme for instance, by using the get_post_snippet() function."
159
  msgstr "En snippet kan hämtas direkt via PHP, till exempel i ett tema, med get_post_snippet() funktionen."
160
 
161
- #: classes/help.php:199
162
  msgid "Usage"
163
  msgstr "Användning"
164
 
165
- #: classes/help.php:207
166
  msgid "Parameters"
167
  msgstr "Parametrar"
168
 
169
- #: classes/help.php:211
170
  msgid "(string) (required) The name of the snippet to retrieve."
171
  msgstr "(sträng) (krävs) Namnet på snippeten att hämta."
172
 
173
- #: classes/help.php:216
174
  msgid "(string) The variables to pass to the snippet, formatted as a query string."
175
  msgstr "(sträng) Variablerna att skicka till snippeten, formatterat som en query sträng."
176
 
@@ -178,66 +190,66 @@ msgstr "(sträng) Variablerna att skicka till snippeten, formatterat som en quer
178
  msgid "Settings"
179
  msgstr "Inställningar"
180
 
181
- #: post-snippets.php:345
182
  msgid "This snippet is insert only, no variables defined."
183
  msgstr "Denna snippet saknar variabler, så den infogas som den är."
184
 
185
- #: post-snippets.php:507
186
  msgid "A snippet named Untitled has been added."
187
  msgstr "En ny snippet med namnet Untitled har lagts till."
188
 
189
- #: post-snippets.php:524
190
- #: post-snippets.php:674
191
  msgid "Snippets have been updated."
192
  msgstr "Ändrade snippets har uppdaterats."
193
 
194
- #: post-snippets.php:540
195
  msgid "Selected snippets have been deleted."
196
  msgstr "Valda snippets har raderats."
197
 
198
- #: post-snippets.php:554
199
  msgid "Import/Export"
200
  msgstr "Importera/Exportera"
201
 
202
- #: post-snippets.php:555
203
  msgid "Export"
204
  msgstr "Exportera"
205
 
206
- #: post-snippets.php:557
207
  msgid "Export your snippets for backup or to import them on another site."
208
  msgstr "Exportera dina snippets för backup eller för att importera dem till en annan sajt."
209
 
210
- #: post-snippets.php:558
211
  msgid "Export Snippets"
212
  msgstr "Exportera snippets"
213
 
214
- #: post-snippets.php:644
215
  msgid "Import"
216
  msgstr "Importera"
217
 
218
- #: post-snippets.php:646
219
  msgid "Import snippets from a post-snippets-export.zip file. Importing overwrites any existing snippets."
220
  msgstr "Importera snippets från en post-snippets-export.zip fil. Importen skriver över eventuella snippets som redan finns."
221
 
222
- #: post-snippets.php:650
223
  msgid "Import Snippets"
224
  msgstr "Importera snippets"
225
 
226
- #: post-snippets.php:676
227
  msgid "Snippets successfully imported."
228
  msgstr "Importeringen av snippets lyckades."
229
 
230
- #: post-snippets.php:678
231
- #: post-snippets.php:682
232
- #: post-snippets.php:684
233
  msgid "Snippets could not be imported:"
234
  msgstr "Snippets kunde inte importeras:"
235
 
236
- #: post-snippets.php:678
237
  msgid "Unzipping failed."
238
  msgstr "Uppackningen misslyckades."
239
 
240
- #: post-snippets.php:684
241
  msgid "Upload failed."
242
  msgstr "Uppladdningen misslyckades."
243
 
@@ -250,8 +262,8 @@ msgid "http://wpstorm.net/wordpress-plugins/post-snippets/"
250
  msgstr "http://wpstorm.net/wordpress-plugins/post-snippets/"
251
 
252
  #. Description of the plugin/theme
253
- msgid "Stores snippets of HTML code or reoccurring text that you often use in your posts. You can use predefined variables to replace parts of the snippet on insert. All snippets are available in the post editor with a TinyMCE button or Quicktags."
254
- msgstr "Lagrar snippets av HTML kod eller återkommande text som du ofta använder i dina inlägg. Du kan använda fördefinerade variabler för att ersätta delar av ditt avsnitt vid infogning. All avsnitt är tillgängliga i inläggsredigeraren via en TinyMCE knapp, Quicktags eller Shortcodes."
255
 
256
  #. Author of the plugin/theme
257
  msgid "Johan Steen"
@@ -261,6 +273,13 @@ msgstr "Johan Steen"
261
  msgid "http://johansteen.se/"
262
  msgstr "http://johansteen.se/"
263
 
 
 
 
 
 
 
 
264
  #~ msgid ""
265
  #~ "This is the block of text or HTML to insert in the post when you select "
266
  #~ "the snippet from the insert button in the TinyMCE panel in the post "
6
  msgstr ""
7
  "Project-Id-Version: Post Snippets\n"
8
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/post-snippets\n"
9
+ "POT-Creation-Date: 2012-02-08 16:54:26+00:00\n"
10
+ "PO-Revision-Date: 2012-02-08 18:01+0100\n"
11
  "Last-Translator: Johan Steen <artstorm@gmail.com>\n"
12
  "Language-Team: <artstorm@gmail.com>\n"
13
  "MIME-Version: 1.0\n"
46
  msgid "Snippet"
47
  msgstr "Snippet"
48
 
49
+ #: classes/settings.php:76
50
  #: classes/help.php:46
51
+ #: classes/help.php:258
52
  msgid "Shortcode"
53
  msgstr "Shortcode"
54
 
55
+ #: classes/settings.php:81
56
  msgid "PHP Code"
57
  msgstr "PHP kod"
58
 
59
+ #: classes/settings.php:90
60
  #: classes/help.php:125
61
  msgid "Description"
62
  msgstr "Beskrivning"
63
 
64
+ #: classes/settings.php:101
65
  msgid "Update Snippets"
66
  msgstr "Uppdatera snippets"
67
 
68
  #: classes/help.php:41
69
+ #: classes/help.php:256
70
  msgid "Basic"
71
  msgstr "Grundläggande"
72
 
73
  #: classes/help.php:51
74
+ #: classes/help.php:260
75
  msgid "PHP"
76
  msgstr "PHP"
77
 
78
  #: classes/help.php:56
79
+ #: classes/help.php:262
80
  msgid "Advanced"
81
  msgstr "Avancerat"
82
 
97
  msgstr "Ge snippeten en titel som hjälper till att identifiera den i inläggsredigeraren. Titeln blir också namnet på shortcoden om du aktiverar det valet."
98
 
99
  #: classes/help.php:101
100
+ msgid "A comma separated list of custom variables you can reference in your snippet. A variable can also be assigned a default value that will be used in the insert window by using the equal sign, variable=default."
101
+ msgstr "En kommaseparerad lista av egna variabler som du kan använda i din snippet. En variabel kan också bli tilldelad ett förinställt värde som kommer användas i infogningsfönstret genom att använda lika-med-tecknet. variabel=värde."
102
 
103
  #: classes/help.php:104
104
  #: classes/help.php:115
105
+ #: classes/help.php:230
106
  msgid "Example"
107
  msgstr "Exempel"
108
 
134
  msgid "If you enclose the shortcode in your posts, you can access the enclosed content by using the variable {content} in your snippet. The {content} variable is reserved, so don't use it in the variables field."
135
  msgstr "Om du innesluter text med shortcoden i dina inlägg, så kan du komma åt det inneslutna innehålet genom att använda variabeln {content} i din snippet. {content} variablen är reserverad, så använd inte det namnet content i variabel fältet."
136
 
137
+ #: classes/help.php:152
138
+ msgid "Options"
139
+ msgstr "Inställningar"
140
+
141
+ #: classes/help.php:155
142
+ msgid "See the dedicated help section for information about PHP shortcodes."
143
+ msgstr "Se hjälp sektionen som är dedikerad till PHP för information om denna inställning."
144
+
145
+ #: classes/help.php:158
146
+ msgid "Before the shortcode is outputted, it can optionally be formatted with %s, to transform quotes to smart quotes, apostrophes, dashes, ellipses, the trademark symbol, and the multiplication symbol."
147
+ msgstr "Innan resultatet från shortcoden visas, kan den formatteras med %s, för att använda vackrare varianter av citationstecken, apostrofer, talstreck, ellipser, trademark och multiplicerings symboler."
148
+
149
+ #: classes/help.php:171
150
  msgid "Snippets defined as shortcodes can optionally also be evaluated as PHP Code by enabling the PHP checkbox. PHP snippets is only available when treating the snippet as a shortcode."
151
  msgstr "Snippets som är definerade som shortcodes, kan om så önskas bli evaluerade som PHP kod genom att aktivera PHP kryssrutan. PHP snippets fungerar endast när snippet är aktiverad som en shortcode."
152
 
153
+ #: classes/help.php:174
154
  msgid "Example PHP Snippet"
155
  msgstr "Exempel PHP Snippet"
156
 
157
+ #: classes/help.php:183
158
  msgid "With a snippet defined like the one above, you can call it with its shortcode definition in a post. Let's pretend that the example snippet is named phpcode and have one variable defined loop_me, then it would be called like this from a post:"
159
  msgstr "Med en snippet definerad som den ovan, kan du komma åt den via dess shortcode namn i ett inlägg. Låt oss säga att exempel snippeten har fått namnet phpcode och att den har en variabel definerad loop_me, då skulle man komma åt den från ett inlägg så här:"
160
 
161
+ #: classes/help.php:189
162
  msgid "When the shortcode is executed the loop_me variable will be replaced with the string supplied in the shortcode and then the PHP code will be evaluated. (Outputting the string five times in this case. Wow!)"
163
  msgstr "När shortcoden körs kommer loop_me variabeln bli ersatt med strängen som definerad från shortcoden och efter det så evalueras PHP koden. (Skriver strängen 5 gånger i detta fallet. Wow!)"
164
 
165
+ #: classes/help.php:192
166
  msgid "Note the evaluation order, any snippet variables will be replaced before the snippet is evaluated as PHP code. Also note that a PHP snippet don't need to be wrapped in &lt;?php #code; ?&gt;."
167
  msgstr "Notera evaluerings ordningen, variabler för snippet kommer ersättas innan snippeten evalueras som PHP kod. Notera också att en PHP snippet inte ska omslutas med &lt;?php #code; ?&gt;."
168
 
169
+ #: classes/help.php:205
170
  msgid "You can retrieve a Post Snippet directly from PHP, in a theme for instance, by using the get_post_snippet() function."
171
  msgstr "En snippet kan hämtas direkt via PHP, till exempel i ett tema, med get_post_snippet() funktionen."
172
 
173
+ #: classes/help.php:209
174
  msgid "Usage"
175
  msgstr "Användning"
176
 
177
+ #: classes/help.php:217
178
  msgid "Parameters"
179
  msgstr "Parametrar"
180
 
181
+ #: classes/help.php:221
182
  msgid "(string) (required) The name of the snippet to retrieve."
183
  msgstr "(sträng) (krävs) Namnet på snippeten att hämta."
184
 
185
+ #: classes/help.php:226
186
  msgid "(string) The variables to pass to the snippet, formatted as a query string."
187
  msgstr "(sträng) Variablerna att skicka till snippeten, formatterat som en query sträng."
188
 
190
  msgid "Settings"
191
  msgstr "Inställningar"
192
 
193
+ #: post-snippets.php:430
194
  msgid "This snippet is insert only, no variables defined."
195
  msgstr "Denna snippet saknar variabler, så den infogas som den är."
196
 
197
+ #: post-snippets.php:577
198
  msgid "A snippet named Untitled has been added."
199
  msgstr "En ny snippet med namnet Untitled har lagts till."
200
 
201
+ #: post-snippets.php:595
202
+ #: post-snippets.php:745
203
  msgid "Snippets have been updated."
204
  msgstr "Ändrade snippets har uppdaterats."
205
 
206
+ #: post-snippets.php:611
207
  msgid "Selected snippets have been deleted."
208
  msgstr "Valda snippets har raderats."
209
 
210
+ #: post-snippets.php:625
211
  msgid "Import/Export"
212
  msgstr "Importera/Exportera"
213
 
214
+ #: post-snippets.php:626
215
  msgid "Export"
216
  msgstr "Exportera"
217
 
218
+ #: post-snippets.php:628
219
  msgid "Export your snippets for backup or to import them on another site."
220
  msgstr "Exportera dina snippets för backup eller för att importera dem till en annan sajt."
221
 
222
+ #: post-snippets.php:629
223
  msgid "Export Snippets"
224
  msgstr "Exportera snippets"
225
 
226
+ #: post-snippets.php:715
227
  msgid "Import"
228
  msgstr "Importera"
229
 
230
+ #: post-snippets.php:717
231
  msgid "Import snippets from a post-snippets-export.zip file. Importing overwrites any existing snippets."
232
  msgstr "Importera snippets från en post-snippets-export.zip fil. Importen skriver över eventuella snippets som redan finns."
233
 
234
+ #: post-snippets.php:721
235
  msgid "Import Snippets"
236
  msgstr "Importera snippets"
237
 
238
+ #: post-snippets.php:747
239
  msgid "Snippets successfully imported."
240
  msgstr "Importeringen av snippets lyckades."
241
 
242
+ #: post-snippets.php:749
243
+ #: post-snippets.php:753
244
+ #: post-snippets.php:755
245
  msgid "Snippets could not be imported:"
246
  msgstr "Snippets kunde inte importeras:"
247
 
248
+ #: post-snippets.php:749
249
  msgid "Unzipping failed."
250
  msgstr "Uppackningen misslyckades."
251
 
252
+ #: post-snippets.php:755
253
  msgid "Upload failed."
254
  msgstr "Uppladdningen misslyckades."
255
 
262
  msgstr "http://wpstorm.net/wordpress-plugins/post-snippets/"
263
 
264
  #. Description of the plugin/theme
265
+ msgid "Build a library with snippets of HTML, PHP code or reoccurring text that you often use in your posts. Variables to replace parts of the snippet on insert can be used. The snippets can be inserted as-is or as shortcodes."
266
+ msgstr "Skapa ett bibliotek av snippets med HTML, PHP kod eller återkommande text som du ofta använder i dina inlägg. Du kan använda fördefinerade variabler för att ersätta delar av ditt avsnitt vid infogning. Snippets kan infogas som text eller som shortcodes."
267
 
268
  #. Author of the plugin/theme
269
  msgid "Johan Steen"
273
  msgid "http://johansteen.se/"
274
  msgstr "http://johansteen.se/"
275
 
276
+ #~ msgid ""
277
+ #~ "A comma separated list of custom variables you can reference in your "
278
+ #~ "snippet."
279
+ #~ msgstr ""
280
+ #~ "En kommaseparerad lista av egendefinerade variabler som du kan referera i "
281
+ #~ "din snippet."
282
+
283
  #~ msgid ""
284
  #~ "This is the block of text or HTML to insert in the post when you select "
285
  #~ "the snippet from the insert button in the TinyMCE panel in the post "
languages/post-snippets.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the Post Snippets package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Post Snippets 1.9\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/post-snippets\n"
7
- "POT-Creation-Date: 2012-01-22 15:13:10+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -36,31 +36,31 @@ msgstr ""
36
  msgid "Snippet"
37
  msgstr ""
38
 
39
- #: classes/settings.php:74 classes/help.php:46 classes/help.php:248
40
  msgid "Shortcode"
41
  msgstr ""
42
 
43
- #: classes/settings.php:77
44
  msgid "PHP Code"
45
  msgstr ""
46
 
47
- #: classes/settings.php:83 classes/help.php:125
48
  msgid "Description"
49
  msgstr ""
50
 
51
- #: classes/settings.php:94
52
  msgid "Update Snippets"
53
  msgstr ""
54
 
55
- #: classes/help.php:41 classes/help.php:246
56
  msgid "Basic"
57
  msgstr ""
58
 
59
- #: classes/help.php:51 classes/help.php:250
60
  msgid "PHP"
61
  msgstr ""
62
 
63
- #: classes/help.php:56 classes/help.php:252
64
  msgid "Advanced"
65
  msgstr ""
66
 
@@ -84,10 +84,12 @@ msgstr ""
84
 
85
  #: classes/help.php:101
86
  msgid ""
87
- "A comma separated list of custom variables you can reference in your snippet."
 
 
88
  msgstr ""
89
 
90
- #: classes/help.php:104 classes/help.php:115 classes/help.php:220
91
  msgid "Example"
92
  msgstr ""
93
 
@@ -138,18 +140,33 @@ msgid ""
138
  "variable is reserved, so don't use it in the variables field."
139
  msgstr ""
140
 
141
- #: classes/help.php:161
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
  msgid ""
143
  "Snippets defined as shortcodes can optionally also be evaluated as PHP Code "
144
  "by enabling the PHP checkbox. PHP snippets is only available when treating "
145
  "the snippet as a shortcode."
146
  msgstr ""
147
 
148
- #: classes/help.php:164
149
  msgid "Example PHP Snippet"
150
  msgstr ""
151
 
152
- #: classes/help.php:173
153
  msgid ""
154
  "With a snippet defined like the one above, you can call it with its "
155
  "shortcode definition in a post. Let's pretend that the example snippet is "
@@ -157,39 +174,39 @@ msgid ""
157
  "like this from a post:"
158
  msgstr ""
159
 
160
- #: classes/help.php:179
161
  msgid ""
162
  "When the shortcode is executed the loop_me variable will be replaced with "
163
  "the string supplied in the shortcode and then the PHP code will be "
164
  "evaluated. (Outputting the string five times in this case. Wow!)"
165
  msgstr ""
166
 
167
- #: classes/help.php:182
168
  msgid ""
169
  "Note the evaluation order, any snippet variables will be replaced before the "
170
  "snippet is evaluated as PHP code. Also note that a PHP snippet don't need to "
171
  "be wrapped in &lt;?php #code; ?&gt;."
172
  msgstr ""
173
 
174
- #: classes/help.php:195
175
  msgid ""
176
  "You can retrieve a Post Snippet directly from PHP, in a theme for instance, "
177
  "by using the get_post_snippet() function."
178
  msgstr ""
179
 
180
- #: classes/help.php:199
181
  msgid "Usage"
182
  msgstr ""
183
 
184
- #: classes/help.php:207
185
  msgid "Parameters"
186
  msgstr ""
187
 
188
- #: classes/help.php:211
189
  msgid "(string) (required) The name of the snippet to retrieve."
190
  msgstr ""
191
 
192
- #: classes/help.php:216
193
  msgid ""
194
  "(string) The variables to pass to the snippet, formatted as a query string."
195
  msgstr ""
@@ -198,65 +215,65 @@ msgstr ""
198
  msgid "Settings"
199
  msgstr ""
200
 
201
- #: post-snippets.php:345
202
  msgid "This snippet is insert only, no variables defined."
203
  msgstr ""
204
 
205
- #: post-snippets.php:507
206
  msgid "A snippet named Untitled has been added."
207
  msgstr ""
208
 
209
- #: post-snippets.php:524 post-snippets.php:674
210
  msgid "Snippets have been updated."
211
  msgstr ""
212
 
213
- #: post-snippets.php:540
214
  msgid "Selected snippets have been deleted."
215
  msgstr ""
216
 
217
- #: post-snippets.php:554
218
  msgid "Import/Export"
219
  msgstr ""
220
 
221
- #: post-snippets.php:555
222
  msgid "Export"
223
  msgstr ""
224
 
225
- #: post-snippets.php:557
226
  msgid "Export your snippets for backup or to import them on another site."
227
  msgstr ""
228
 
229
- #: post-snippets.php:558
230
  msgid "Export Snippets"
231
  msgstr ""
232
 
233
- #: post-snippets.php:644
234
  msgid "Import"
235
  msgstr ""
236
 
237
- #: post-snippets.php:646
238
  msgid ""
239
  "Import snippets from a post-snippets-export.zip file. Importing overwrites "
240
  "any existing snippets."
241
  msgstr ""
242
 
243
- #: post-snippets.php:650
244
  msgid "Import Snippets"
245
  msgstr ""
246
 
247
- #: post-snippets.php:676
248
  msgid "Snippets successfully imported."
249
  msgstr ""
250
 
251
- #: post-snippets.php:678 post-snippets.php:682 post-snippets.php:684
252
  msgid "Snippets could not be imported:"
253
  msgstr ""
254
 
255
- #: post-snippets.php:678
256
  msgid "Unzipping failed."
257
  msgstr ""
258
 
259
- #: post-snippets.php:684
260
  msgid "Upload failed."
261
  msgstr ""
262
 
@@ -270,10 +287,9 @@ msgstr ""
270
 
271
  #. Description of the plugin/theme
272
  msgid ""
273
- "Stores snippets of HTML code or reoccurring text that you often use in your "
274
- "posts. You can use predefined variables to replace parts of the snippet on "
275
- "insert. All snippets are available in the post editor with a TinyMCE button "
276
- "or Quicktags."
277
  msgstr ""
278
 
279
  #. Author of the plugin/theme
2
  # This file is distributed under the same license as the Post Snippets package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Post Snippets 1.9.3\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/post-snippets\n"
7
+ "POT-Creation-Date: 2012-02-08 16:54:26+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
36
  msgid "Snippet"
37
  msgstr ""
38
 
39
+ #: classes/settings.php:76 classes/help.php:46 classes/help.php:258
40
  msgid "Shortcode"
41
  msgstr ""
42
 
43
+ #: classes/settings.php:81
44
  msgid "PHP Code"
45
  msgstr ""
46
 
47
+ #: classes/settings.php:90 classes/help.php:125
48
  msgid "Description"
49
  msgstr ""
50
 
51
+ #: classes/settings.php:101
52
  msgid "Update Snippets"
53
  msgstr ""
54
 
55
+ #: classes/help.php:41 classes/help.php:256
56
  msgid "Basic"
57
  msgstr ""
58
 
59
+ #: classes/help.php:51 classes/help.php:260
60
  msgid "PHP"
61
  msgstr ""
62
 
63
+ #: classes/help.php:56 classes/help.php:262
64
  msgid "Advanced"
65
  msgstr ""
66
 
84
 
85
  #: classes/help.php:101
86
  msgid ""
87
+ "A comma separated list of custom variables you can reference in your "
88
+ "snippet. A variable can also be assigned a default value that will be used "
89
+ "in the insert window by using the equal sign, variable=default."
90
  msgstr ""
91
 
92
+ #: classes/help.php:104 classes/help.php:115 classes/help.php:230
93
  msgid "Example"
94
  msgstr ""
95
 
140
  "variable is reserved, so don't use it in the variables field."
141
  msgstr ""
142
 
143
+ #: classes/help.php:152
144
+ msgid "Options"
145
+ msgstr ""
146
+
147
+ #: classes/help.php:155
148
+ msgid "See the dedicated help section for information about PHP shortcodes."
149
+ msgstr ""
150
+
151
+ #: classes/help.php:158
152
+ msgid ""
153
+ "Before the shortcode is outputted, it can optionally be formatted with %s, "
154
+ "to transform quotes to smart quotes, apostrophes, dashes, ellipses, the "
155
+ "trademark symbol, and the multiplication symbol."
156
+ msgstr ""
157
+
158
+ #: classes/help.php:171
159
  msgid ""
160
  "Snippets defined as shortcodes can optionally also be evaluated as PHP Code "
161
  "by enabling the PHP checkbox. PHP snippets is only available when treating "
162
  "the snippet as a shortcode."
163
  msgstr ""
164
 
165
+ #: classes/help.php:174
166
  msgid "Example PHP Snippet"
167
  msgstr ""
168
 
169
+ #: classes/help.php:183
170
  msgid ""
171
  "With a snippet defined like the one above, you can call it with its "
172
  "shortcode definition in a post. Let's pretend that the example snippet is "
174
  "like this from a post:"
175
  msgstr ""
176
 
177
+ #: classes/help.php:189
178
  msgid ""
179
  "When the shortcode is executed the loop_me variable will be replaced with "
180
  "the string supplied in the shortcode and then the PHP code will be "
181
  "evaluated. (Outputting the string five times in this case. Wow!)"
182
  msgstr ""
183
 
184
+ #: classes/help.php:192
185
  msgid ""
186
  "Note the evaluation order, any snippet variables will be replaced before the "
187
  "snippet is evaluated as PHP code. Also note that a PHP snippet don't need to "
188
  "be wrapped in &lt;?php #code; ?&gt;."
189
  msgstr ""
190
 
191
+ #: classes/help.php:205
192
  msgid ""
193
  "You can retrieve a Post Snippet directly from PHP, in a theme for instance, "
194
  "by using the get_post_snippet() function."
195
  msgstr ""
196
 
197
+ #: classes/help.php:209
198
  msgid "Usage"
199
  msgstr ""
200
 
201
+ #: classes/help.php:217
202
  msgid "Parameters"
203
  msgstr ""
204
 
205
+ #: classes/help.php:221
206
  msgid "(string) (required) The name of the snippet to retrieve."
207
  msgstr ""
208
 
209
+ #: classes/help.php:226
210
  msgid ""
211
  "(string) The variables to pass to the snippet, formatted as a query string."
212
  msgstr ""
215
  msgid "Settings"
216
  msgstr ""
217
 
218
+ #: post-snippets.php:430
219
  msgid "This snippet is insert only, no variables defined."
220
  msgstr ""
221
 
222
+ #: post-snippets.php:577
223
  msgid "A snippet named Untitled has been added."
224
  msgstr ""
225
 
226
+ #: post-snippets.php:595 post-snippets.php:745
227
  msgid "Snippets have been updated."
228
  msgstr ""
229
 
230
+ #: post-snippets.php:611
231
  msgid "Selected snippets have been deleted."
232
  msgstr ""
233
 
234
+ #: post-snippets.php:625
235
  msgid "Import/Export"
236
  msgstr ""
237
 
238
+ #: post-snippets.php:626
239
  msgid "Export"
240
  msgstr ""
241
 
242
+ #: post-snippets.php:628
243
  msgid "Export your snippets for backup or to import them on another site."
244
  msgstr ""
245
 
246
+ #: post-snippets.php:629
247
  msgid "Export Snippets"
248
  msgstr ""
249
 
250
+ #: post-snippets.php:715
251
  msgid "Import"
252
  msgstr ""
253
 
254
+ #: post-snippets.php:717
255
  msgid ""
256
  "Import snippets from a post-snippets-export.zip file. Importing overwrites "
257
  "any existing snippets."
258
  msgstr ""
259
 
260
+ #: post-snippets.php:721
261
  msgid "Import Snippets"
262
  msgstr ""
263
 
264
+ #: post-snippets.php:747
265
  msgid "Snippets successfully imported."
266
  msgstr ""
267
 
268
+ #: post-snippets.php:749 post-snippets.php:753 post-snippets.php:755
269
  msgid "Snippets could not be imported:"
270
  msgstr ""
271
 
272
+ #: post-snippets.php:749
273
  msgid "Unzipping failed."
274
  msgstr ""
275
 
276
+ #: post-snippets.php:755
277
  msgid "Upload failed."
278
  msgstr ""
279
 
287
 
288
  #. Description of the plugin/theme
289
  msgid ""
290
+ "Build a library with snippets of HTML, PHP code or reoccurring text that you "
291
+ "often use in your posts. Variables to replace parts of the snippet on insert "
292
+ "can be used. The snippets can be inserted as-is or as shortcodes."
 
293
  msgstr ""
294
 
295
  #. Author of the plugin/theme
post-snippets.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Post Snippets
4
  Plugin URI: http://wpstorm.net/wordpress-plugins/post-snippets/
5
  Description: Build a library with snippets of HTML, PHP code or reoccurring text that you often use in your posts. Variables to replace parts of the snippet on insert can be used. The snippets can be inserted as-is or as shortcodes.
6
- Version: 1.9.3
7
  Author: Johan Steen
8
  Author URI: http://johansteen.se/
9
  Text Domain: post-snippets
@@ -96,12 +96,12 @@ class Post_Snippets {
96
  function enqueue_assets() {
97
  wp_enqueue_script( 'jquery-ui-dialog' );
98
  wp_enqueue_script( 'jquery-ui-tabs' );
99
- wp_enqueue_style( 'wp-jquery-ui-dialog');
100
 
101
  # Adds the CSS stylesheet for the jQuery UI dialog
102
  $style_url = plugins_url( '/assets/post-snippets.css', $this->get_FILE() );
103
  wp_register_style( 'post-snippets', $style_url, false, '1.0' );
104
- wp_enqueue_style( 'post-snippets');
105
  }
106
 
107
 
@@ -411,11 +411,9 @@ function edOpenPostSnippets(myField) {
411
  // Default value exists?
412
  $def_pos = strpos( $var, '=' );
413
  if ( $def_pos !== false ) {
414
- $split = str_split( $var, $def_pos );
415
  $var = $split[0];
416
  $def = $split[1];
417
- // Remove the = (first char) in the default value
418
- $def = substr( $def, 1 );
419
  } else {
420
  $def = '';
421
  }
@@ -482,6 +480,9 @@ function edOpenPostSnippets(myField) {
482
  $vars_str = $vars_str . '"'.$var.'" => "",';
483
  }
484
 
 
 
 
485
  add_shortcode($snippet['title'], create_function('$atts,$content=null',
486
  '$shortcode_symbols = array('.$vars_str.');
487
  extract(shortcode_atts($shortcode_symbols, $atts));
@@ -500,12 +501,22 @@ function edOpenPostSnippets(myField) {
500
  $snippet = str_replace("{".$key."}", $val, $snippet);
501
  }
502
 
 
503
  $php = "'. $snippet["php"] .'";
504
  if ($php == true) {
505
  $snippet = Post_Snippets::php_eval( $snippet );
506
  }
507
 
508
- return do_shortcode(stripslashes($snippet));') );
 
 
 
 
 
 
 
 
 
509
  }
510
  }
511
  }
@@ -558,6 +569,7 @@ function edOpenPostSnippets(myField) {
558
  'description' => "",
559
  'shortcode' => false,
560
  'php' => false,
 
561
  'snippet' => ""));
562
  update_option($this->plugin_options, $snippets);
563
  $this->admin_message( __( 'A snippet named Untitled has been added.', 'post-snippets' ) );
@@ -572,6 +584,7 @@ function edOpenPostSnippets(myField) {
572
  $new_snippets[$key]['vars'] = str_replace(' ', '', trim($_POST[$key.'_vars']) );
573
  $new_snippets[$key]['shortcode'] = isset($_POST[$key.'_shortcode']) ? true : false;
574
  $new_snippets[$key]['php'] = isset($_POST[$key.'_php']) ? true : false;
 
575
 
576
  $new_snippets[$key]['snippet'] = wp_specialchars_decode( trim(stripslashes($_POST[$key.'_snippet'])), ENT_NOQUOTES);
577
  $new_snippets[$key]['description'] = wp_specialchars_decode( trim(stripslashes($_POST[$key.'_description'])), ENT_NOQUOTES);
3
  Plugin Name: Post Snippets
4
  Plugin URI: http://wpstorm.net/wordpress-plugins/post-snippets/
5
  Description: Build a library with snippets of HTML, PHP code or reoccurring text that you often use in your posts. Variables to replace parts of the snippet on insert can be used. The snippets can be inserted as-is or as shortcodes.
6
+ Version: 1.9.4
7
  Author: Johan Steen
8
  Author URI: http://johansteen.se/
9
  Text Domain: post-snippets
96
  function enqueue_assets() {
97
  wp_enqueue_script( 'jquery-ui-dialog' );
98
  wp_enqueue_script( 'jquery-ui-tabs' );
99
+ wp_enqueue_style( 'wp-jquery-ui-dialog' );
100
 
101
  # Adds the CSS stylesheet for the jQuery UI dialog
102
  $style_url = plugins_url( '/assets/post-snippets.css', $this->get_FILE() );
103
  wp_register_style( 'post-snippets', $style_url, false, '1.0' );
104
+ wp_enqueue_style( 'post-snippets' );
105
  }
106
 
107
 
411
  // Default value exists?
412
  $def_pos = strpos( $var, '=' );
413
  if ( $def_pos !== false ) {
414
+ $split = explode( '=', $var );
415
  $var = $split[0];
416
  $def = $split[1];
 
 
417
  } else {
418
  $def = '';
419
  }
480
  $vars_str = $vars_str . '"'.$var.'" => "",';
481
  }
482
 
483
+ // Get the wptexturize setting
484
+ $texturize = isset( $snippet["wptexturize"] ) ? $snippet["wptexturize"] : false;
485
+
486
  add_shortcode($snippet['title'], create_function('$atts,$content=null',
487
  '$shortcode_symbols = array('.$vars_str.');
488
  extract(shortcode_atts($shortcode_symbols, $atts));
501
  $snippet = str_replace("{".$key."}", $val, $snippet);
502
  }
503
 
504
+ // Handle PHP shortcodes
505
  $php = "'. $snippet["php"] .'";
506
  if ($php == true) {
507
  $snippet = Post_Snippets::php_eval( $snippet );
508
  }
509
 
510
+ // Strip escaping and execute nested shortcodes
511
+ $snippet = do_shortcode(stripslashes($snippet));
512
+
513
+ // WPTexturize the Snippet
514
+ $texturize = "'. $texturize .'";
515
+ if ($texturize == true) {
516
+ $snippet = wptexturize( $snippet );
517
+ }
518
+
519
+ return $snippet;') );
520
  }
521
  }
522
  }
569
  'description' => "",
570
  'shortcode' => false,
571
  'php' => false,
572
+ 'wptexturize' => false,
573
  'snippet' => ""));
574
  update_option($this->plugin_options, $snippets);
575
  $this->admin_message( __( 'A snippet named Untitled has been added.', 'post-snippets' ) );
584
  $new_snippets[$key]['vars'] = str_replace(' ', '', trim($_POST[$key.'_vars']) );
585
  $new_snippets[$key]['shortcode'] = isset($_POST[$key.'_shortcode']) ? true : false;
586
  $new_snippets[$key]['php'] = isset($_POST[$key.'_php']) ? true : false;
587
+ $new_snippets[$key]['wptexturize'] = isset($_POST[$key.'_wptexturize']) ? true : false;
588
 
589
  $new_snippets[$key]['snippet'] = wp_specialchars_decode( trim(stripslashes($_POST[$key.'_snippet'])), ENT_NOQUOTES);
590
  $new_snippets[$key]['description'] = wp_specialchars_decode( trim(stripslashes($_POST[$key.'_description'])), ENT_NOQUOTES);
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wpstorm.net/wordpress-plugins/post-snippets/#donation
4
  Tags: post, admin, snippet, shortcode, html, custom, page, dynamic, editor, php, code
5
  Requires at least: 3.0
6
  Tested up to: 3.3.1
7
- Stable tag: 1.9.3
8
 
9
  Keep a snippet library of text, HTML or PHP code to be used in posts. Variables
10
  can be set for more flexibility. Inserts directly or as shortcodes.
@@ -92,6 +92,10 @@ for questions, answers, support and feature requests.
92
 
93
  == Changelog ==
94
 
 
 
 
 
95
  = Version 1.9.3 - 30 Jan 2012 =
96
  * Fixed a bug that variables using a default value wasn't inserted properly.
97
 
4
  Tags: post, admin, snippet, shortcode, html, custom, page, dynamic, editor, php, code
5
  Requires at least: 3.0
6
  Tested up to: 3.3.1
7
+ Stable tag: 1.9.4
8
 
9
  Keep a snippet library of text, HTML or PHP code to be used in posts. Variables
10
  can be set for more flexibility. Inserts directly or as shortcodes.
92
 
93
  == Changelog ==
94
 
95
+ = Version 1.9.4 - 8 Feb 2012 =
96
+ * Added an option to run shortcodes through wptexturize before output.
97
+ * Bugfix: Default values could be cut off. Corrected in this update.
98
+
99
  = Version 1.9.3 - 30 Jan 2012 =
100
  * Fixed a bug that variables using a default value wasn't inserted properly.
101