Post Snippets - Version 1.8.2

Version Description

Download this release

Release Info

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

Code changes from version 1.8.1 to 1.8.2

languages/post-snippets-lt_LT.mo ADDED
Binary file
languages/post-snippets-lt_LT.po ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ msgid ""
2
+ msgstr ""
3
+ "Project-Id-Version: Post Snippets v1.4.9\n"
4
+ "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: \n"
6
+ "PO-Revision-Date: 2011-08-31 15:55+0200\n"
7
+ "Last-Translator: Тарас Данилюк <nikman851@gmail.com>\n"
8
+ "Language-Team: Nata Strazda <nata.strazda@gmail.com>\n"
9
+ "MIME-Version: 1.0\n"
10
+ "Content-Type: text/plain; charset=UTF-8\n"
11
+ "Content-Transfer-Encoding: 8bit\n"
12
+ "Plural-Forms: nplurals=2; plural=n != 1;\n"
13
+ "X-Poedit-Language: Lithuanian\n"
14
+ "X-Poedit-Country: LITHUANIA\n"
15
+ "X-Poedit-SourceCharset: utf-8\n"
16
+ "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2\n"
17
+ "X-Poedit-Basepath: ../\n"
18
+ "X-Textdomain-Support: yes\n"
19
+ "X-Poedit-SearchPath-0: .\n"
20
+
21
+ #@ post-snippets
22
+ #: post-snippets.php:71
23
+ msgid "Post Snippets requires WordPress version 2.7 or later!"
24
+ msgstr "Paštu Fragmentai reikia WordPress versija 2.7 arba naujesnė versija!"
25
+
26
+ #@ post-snippets
27
+ #: post-snippets.php:237
28
+ msgid "A snippet named Untitled has been added."
29
+ msgstr "Buvo pavadintas Be pavadinimo fragmentą."
30
+
31
+ #@ post-snippets
32
+ #: post-snippets.php:262
33
+ msgid "Snippets have been updated."
34
+ msgstr "Fragmentai buvo atnaujintas."
35
+
36
+ #@ post-snippets
37
+ #: post-snippets.php:278
38
+ msgid "Selected snippets have been deleted."
39
+ msgstr "Pasirinkta fragmentai buvo ištrintos."
40
+
41
+ #@ post-snippets
42
+ #: post-snippets.php:290
43
+ msgid "Add New Snippet"
44
+ msgstr "Pridėti Naujas fragmento"
45
+
46
+ #@ post-snippets
47
+ #: post-snippets.php:291
48
+ msgid "Delete Selected"
49
+ msgstr "ištrinti pažymėtus"
50
+
51
+ #@ post-snippets
52
+ #: post-snippets.php:300
53
+ #: post-snippets.php:311
54
+ msgid "Title"
55
+ msgstr "pavadinimas"
56
+
57
+ #@ post-snippets
58
+ #: post-snippets.php:301
59
+ #: post-snippets.php:312
60
+ msgid "Variables"
61
+ msgstr "kintamieji"
62
+
63
+ #@ post-snippets
64
+ #: post-snippets.php:302
65
+ #: post-snippets.php:313
66
+ msgid "Snippet"
67
+ msgstr "fragmentą"
68
+
69
+ #@ post-snippets
70
+ #: post-snippets.php:303
71
+ #: post-snippets.php:314
72
+ msgid "SC"
73
+ msgstr "SC"
74
+
75
+ #@ post-snippets
76
+ #: post-snippets.php:304
77
+ #: post-snippets.php:315
78
+ msgid "QT"
79
+ msgstr "QT"
80
+
81
+ #@ post-snippets
82
+ #: post-snippets.php:339
83
+ msgid "Update Snippets"
84
+ msgstr "atnaujinti Fragmentai"
85
+
86
+ #@ post-snippets
87
+ #: post-snippets.php:344
88
+ msgid "Help"
89
+ msgstr "padėti"
90
+
91
+ #@ post-snippets
92
+ #: post-snippets.php:346
93
+ msgid "<strong>Title</strong><br/>Give the snippet a title that helps you identify it in the post editor."
94
+ msgstr "<strong>Pavadinimas </strong><br/> fragmentą pavadinimą, kuris padės jums nustatyti pranešimų redaktorių."
95
+
96
+ #@ post-snippets
97
+ #: post-snippets.php:348
98
+ msgid "<strong>Variables</strong><br/>A comma separated list of custom variables you can reference in your snippet.<br/><br/>Example:<br/>url,name"
99
+ msgstr "<strong Kintamieji</strong> <br/> atskirti kableliais užsakymą kintamųjų, kuriuos gali savo fragmentą nuoroda<br/>Pavyzdys:<br/> url, vardas"
100
+
101
+ #@ post-snippets
102
+ #: post-snippets.php:350
103
+ msgid "<strong>Snippet</strong><br/>This is the block of text or HTML to insert in the post when you select the snippet from the insert button in the TinyMCE panel in the post editor. If you have entered predefined variables you can reference them from the snippet by enclosing them in {} brackets.<br/><br/>Example:<br/>To reference the variables in the example above, you would enter {url} and {name}.<br/><br/>So if you enter this snippet:<br/><i>This is the website of &lt;a href=\"{url}\"&gt;{name}&lt;/a&gt;</i><br/>You will get the option to replace url and name on insert if they are defined as variables."
104
+ msgstr "<strong>Snippet</strong><br/>C'est le bloc de texte ou HTML à insérer dans l'article lorsque vous sélectionnez l'extrait à partir du bouton insérer dans le panneau TinyMCE de l'éditeur de pages. Si vous avez entré les variables prédéfinies, vous pouvez les inclure dans l'extrait en les entourant de {} crochets. <br/> Exemple: <br/> Pour inclure des variables dans l'exemple ci-dessus, vous devez entrer {url} et {name}. <br/> Donc, si vous entrez le code suivant: <br/> <i> Ceci est le site de &lt;a href=\"{url}\"&gt;{name}&lt;/a&gt;</i><br/> </ i> <br/> Vous avez la possibilité de remplacer les URL et le nom s'ils sont définis comme des variables."
105
+
106
+ #@ post-snippets
107
+ #: post-snippets.php:352
108
+ msgid "<strong>SC</strong><br/>Treats the snippet as a shortcode. The name for the shortcode is the same as the title of the snippet (spaces not allowed) and will be used on insert."
109
+ msgstr "<strong>AB</strong> <br/> traktuoja kaip trumpasis fragmentą.Trumpasis pavadinimas fragmento pavadinimą (erdves neleidžiama) ir bus naudojamas įterpti."
110
+
111
+ #@ post-snippets
112
+ #: post-snippets.php:354
113
+ msgid "<strong>QT</strong><br/>Enables the snippet to be available as a quicktag in the HTML editor."
114
+ msgstr "<strong>QT</strong><br/>Enables the snippet to be available as a quicktag in the HTML editor."
115
+
116
+ #@ post-snippets
117
+ #: post-snippets.php:356
118
+ msgid "<strong>About Post Snippets</strong><br/>Visit my <a href=\"http://coding.cglounge.com/wordpress-plugins/post-snippets/\">Post Snippets</a> page for additional information."
119
+ msgstr "<strong>A propos de Rašyti Fragmentai</strong> <br/> Visitez la page de <a href=\"http://coding.cglounge.com/wordpress-plugins/post-snippets/\">Visitez la puslapyje de</a>Visitez la puslapyje de"
120
+
121
+ #@ post-snippets
122
+ #: tinymce/window.php:16
123
+ msgid "You are not allowed to be here"
124
+ msgstr "Jums neleidžiama būti čia"
125
+
126
+ #@ post-snippets
127
+ #: tinymce/window.php:148
128
+ msgid "Cancel"
129
+ msgstr "atšaukti"
130
+
131
+ #@ post-snippets
132
+ #: tinymce/window.php:152
133
+ msgid "Insert"
134
+ msgstr "įterpti"
135
+
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: 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.
6
- Version: 1.8.1
7
  Author: Johan Steen
8
  Author URI: http://wpstorm.net/
9
  Text Domain: post-snippets
@@ -335,16 +335,20 @@ function edOpenPostSnippets(myField) {
335
  $vars_str = $vars_str . '"'.$vars[$j].'" => "",';
336
 
337
  }
338
- add_shortcode($snippets[$i]['title'], create_function('$atts',
339
  '$shortcode_symbols = array('.$vars_str.');
340
  extract(shortcode_atts($shortcode_symbols, $atts));
341
 
342
- $newArr = compact( array_keys($shortcode_symbols) );
 
 
 
 
343
 
344
  $snippet = "'. addslashes($snippets[$i]["snippet"]) .'";
345
  $snippet = str_replace("&", "&amp;", $snippet);
346
 
347
- foreach ($newArr as $key => $val) {
348
  $snippet = str_replace("{".$key."}", $val, $snippet);
349
  }
350
 
@@ -395,8 +399,8 @@ function edOpenPostSnippets(myField) {
395
  '<p><strong>' . __('Description', 'post-snippets') . '</strong></p>' .
396
  '<p>' . __('An optional description for the Snippet. If entered it will be displayed in the snippets popup window in the post editor.', 'post-snippets') . '</p>' .
397
 
398
- '<p><strong>' . __('SC', 'post-snippets') . '</strong></p>' .
399
- '<p>' . __('Treats the snippet as a shortcode. The name for the shortcode is the same as the title of the snippet (spaces not allowed) and will be used on insert.', 'post-snippets') . '</p>' .
400
 
401
  '<p><strong>' . __('Advanced', 'post-snippets') . '</strong></p>' .
402
  '<p>' . __('The snippets can be retrieved directly from PHP, in a theme for instance, with the get_post_snippet() function. Visit the Post Snippets link under more information for instructions.', 'post-snippets') . '</p>' .
3
  Plugin Name: Post Snippets
4
  Plugin URI: http://wpstorm.net/wordpress-plugins/post-snippets/
5
  Description: 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.
6
+ Version: 1.8.2
7
  Author: Johan Steen
8
  Author URI: http://wpstorm.net/
9
  Text Domain: post-snippets
335
  $vars_str = $vars_str . '"'.$vars[$j].'" => "",';
336
 
337
  }
338
+ add_shortcode($snippets[$i]['title'], create_function('$atts,$content=null',
339
  '$shortcode_symbols = array('.$vars_str.');
340
  extract(shortcode_atts($shortcode_symbols, $atts));
341
 
342
+ $attributes = compact( array_keys($shortcode_symbols) );
343
+
344
+ // Add enclosed content if available to the attributes array
345
+ if ( $content != null )
346
+ $attributes["content"] = $content;
347
 
348
  $snippet = "'. addslashes($snippets[$i]["snippet"]) .'";
349
  $snippet = str_replace("&", "&amp;", $snippet);
350
 
351
+ foreach ($attributes as $key => $val) {
352
  $snippet = str_replace("{".$key."}", $val, $snippet);
353
  }
354
 
399
  '<p><strong>' . __('Description', 'post-snippets') . '</strong></p>' .
400
  '<p>' . __('An optional description for the Snippet. If entered it will be displayed in the snippets popup window in the post editor.', 'post-snippets') . '</p>' .
401
 
402
+ '<p><strong>' . __('Shortcode', 'post-snippets') . '</strong></p>' .
403
+ '<p>' . __('Treats the snippet as a shortcode. The name for the shortcode is the same as the title of the snippet (spaces not allowed) and will be used on insert. 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') . '</p>' .
404
 
405
  '<p><strong>' . __('Advanced', 'post-snippets') . '</strong></p>' .
406
  '<p>' . __('The snippets can be retrieved directly from PHP, in a theme for instance, with the get_post_snippet() function. Visit the Post Snippets link under more information for instructions.', 'post-snippets') . '</p>' .
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: artstorm
3
  Donate link: http://wpstorm.net/wordpress-plugins/post-snippets/#donation
4
  Tags: post, admin, snippet, html, custom, page, dynamic, editor, quicktag
5
  Requires at least: 3.0
6
- Tested up to: 3.2
7
- Stable tag: 1.8.1
8
 
9
  Store snippets of HTML code or reoccurring text that you often use in your posts. Custom variables can be used.
10
 
@@ -50,6 +50,10 @@ See the [Changelog](http://wordpress.org/extend/plugins/post-snippets/changelog/
50
 
51
  Upload of zip files must be allowed, enable this in Sites Network Admin -> Settings -> Upload Settings -> Upload file types.
52
 
 
 
 
 
53
  = Where can I get support? =
54
 
55
  Please visit the [Support Forum](http://wordpress.org/tags/post-snippets?forum_id=10 "Use this for support and feature requests") for questions, answers, support and feature requests.
@@ -62,6 +66,11 @@ Please visit the [Support Forum](http://wordpress.org/tags/post-snippets?forum_i
62
 
63
  == Changelog ==
64
 
 
 
 
 
 
65
  = Version 1.8.1 - 11 Jul 2011 =
66
  * Fixed that a PHP warning is thrown when other scripts called the get_post_snippet() function without supplying a second argument.
67
 
3
  Donate link: http://wpstorm.net/wordpress-plugins/post-snippets/#donation
4
  Tags: post, admin, snippet, html, custom, page, dynamic, editor, quicktag
5
  Requires at least: 3.0
6
+ Tested up to: 3.2.1
7
+ Stable tag: 1.8.2
8
 
9
  Store snippets of HTML code or reoccurring text that you often use in your posts. Custom variables can be used.
10
 
50
 
51
  Upload of zip files must be allowed, enable this in Sites Network Admin -> Settings -> Upload Settings -> Upload file types.
52
 
53
+ = How can I use the content in an enclosed shortcode? =
54
+
55
+ If the shortcode is enclosed with content in a post. Example: [shortcode]Some text[/shortcode] the text within will be availble in a variable named content. So in your snippet use {content} to display it. Don't use content in the variable field, it's automatically assigned. Example: Hello {content}.
56
+
57
  = Where can I get support? =
58
 
59
  Please visit the [Support Forum](http://wordpress.org/tags/post-snippets?forum_id=10 "Use this for support and feature requests") for questions, answers, support and feature requests.
66
 
67
  == Changelog ==
68
 
69
+ = Version 1.8.2 - 3 Sep 2011 =
70
+ * Added support for using enclosed shortcodes with the snippets. Use the variable {content} in your snippets to retrieve the enclosed content.
71
+ * Updated the dropdown help text.
72
+ * Included Lithuanian translation by [Nata Strazda](http://www.webhostinghub.com/).
73
+
74
  = Version 1.8.1 - 11 Jul 2011 =
75
  * Fixed that a PHP warning is thrown when other scripts called the get_post_snippet() function without supplying a second argument.
76