Post Snippets - Version 1.9.7

Version Description

Download this release

Release Info

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

Code changes from version 1.9.6 to 1.9.7

assets/post-snippets.css CHANGED
@@ -1,41 +1,69 @@
1
  /**
2
  * Styling for the jQuery UI dialog used by Post Snippets
3
  *
4
- * @version 1.0
5
  * @since Post Snippets 1.7.1
6
  */
7
  #post-snippets-tabs {
8
- padding: 15px 15px 3px;
9
- background-color: #f1f1f1;
 
 
 
 
 
 
 
 
 
10
  border-bottom: 1px solid #dfdfdf;
 
11
  }
12
- #post-snippets-tabs li {
13
- display: inline;
 
 
 
 
 
 
 
 
14
  }
15
- #post-snippets-tabs li {
16
- color: #2583AD;
17
- padding: 6px 6px 6px 6px;
18
- border-width: 1px 1px 0;
19
- border-style: solid solid none;
20
- border-color: #f1f1f1;
 
 
 
21
  }
22
- #post-snippets-tabs li.ui-tabs-selected {
 
 
 
 
23
  background-color: #fff;
24
- border-color: #dfdfdf;
25
- border-bottom-color: #fff;
26
- color: #d54e21;
27
  }
28
- #post-snippets-tabs li.ui-state-hover {
29
- color: #d54e21;
 
 
30
  }
31
- #post-snippets-tabs a {
32
- text-decoration: none;
 
 
33
  }
34
  #post-snippets-tabs .ui-tabs-panel {
35
- margin: 5px 0 0 0;
36
- padding: 5px 20px 10px;
37
- background-color: #fff;
38
- border-left: 1px solid #dfdfdf;
39
- border-bottom: 1px solid #dfdfdf;
40
- border: 1px solid #dfdfdf;
41
- }
 
1
  /**
2
  * Styling for the jQuery UI dialog used by Post Snippets
3
  *
4
+ * @version 2.0
5
  * @since Post Snippets 1.7.1
6
  */
7
  #post-snippets-tabs {
8
+ /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
9
+ position: relative;
10
+ padding: .2em;
11
+ zoom: 1;
12
+ }
13
+ #post-snippets-tabs .ui-tabs-nav {
14
+ margin: 0;
15
+ padding: .2em .2em 0;
16
+
17
+ /* Overrides */
18
+ background-color: #f9f9f9;
19
  border-bottom: 1px solid #dfdfdf;
20
+ padding-bottom: 1px;
21
  }
22
+
23
+ #post-snippets-tabs .ui-tabs-nav li {
24
+ list-style: none;
25
+ float: left;
26
+ position: relative;
27
+ top: 1px;
28
+ margin: 0 .2em 1px 0;
29
+ border-bottom: 0 !important;
30
+ padding: 0;
31
+ white-space: nowrap;
32
  }
33
+ #post-snippets-tabs .ui-tabs-nav li a {
34
+ float: left;
35
+ padding: .5em 1em;
36
+ text-decoration: none;
37
+
38
+ /* Overrides */
39
+ border: 1px solid #dfdfdf;
40
+ -webkit-border-radius: 3px;
41
+ border-radius: 3px;
42
  }
43
+ #post-snippets-tabs .ui-tabs-nav li.ui-tabs-selected {
44
+ margin-bottom: 0;
45
+ padding-bottom: 1px;
46
+
47
+ /* Overrides */
48
  background-color: #fff;
49
+ padding-bottom: 0;
 
 
50
  }
51
+ #post-snippets-tabs .ui-tabs-nav li.ui-tabs-selected a,
52
+ #post-snippets-tabs .ui-tabs-nav li.ui-state-disabled a,
53
+ #post-snippets-tabs .ui-tabs-nav li.ui-state-processing a {
54
+ cursor: text;
55
  }
56
+ #post-snippets-tabs .ui-tabs-nav li a,
57
+ #post-snippets-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a {
58
+ /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
59
+ cursor: pointer;
60
  }
61
  #post-snippets-tabs .ui-tabs-panel {
62
+ display: block;
63
+ border-width: 0;
64
+ padding: 1em 1.4em;
65
+ background: none;
66
+ }
67
+ #post-snippets-tabs .ui-tabs-hide {
68
+ display: none !important;
69
+ }
classes/settings.php CHANGED
@@ -11,15 +11,79 @@
11
  */
12
  class Post_Snippets_Settings
13
  {
 
 
 
14
 
15
- private $plugin_options;
16
 
17
- public function set_options( $options )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  {
19
- $this->plugin_options = $options;
 
 
 
 
 
 
 
 
20
  }
21
 
22
- public function render()
 
 
 
 
 
 
 
23
  {
24
  ?>
25
  <div class=wrap>
@@ -58,8 +122,7 @@ class Post_Snippets_Settings
58
 
59
  <tbody>
60
  <?php
61
- // $snippets = get_option($this->plugin_options);
62
- $snippets = $this->plugin_options;
63
  if (!empty($snippets)) {
64
  foreach ($snippets as $key => $snippet) {
65
  ?>
@@ -97,31 +160,122 @@ class Post_Snippets_Settings
97
  ?>
98
  </tbody>
99
  </table>
100
- <div class="submit">
101
- <input type="submit" name="update-post-snippets" value="<?php _e( 'Update Snippets', 'post-snippets' ) ?>" class="button-primary" /></div>
102
- </form>
103
- </div>
104
  <?php
 
 
 
 
 
105
  }
106
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
  // -------------------------------------------------------------------------
108
  // HTML and Form element methods
109
  // -------------------------------------------------------------------------
110
 
111
  /**
112
  * Checkbox.
 
113
  * Renders the HTML for an input checkbox.
114
  *
115
  * @param string $label The label rendered to screen
116
- * @param string $name The unique name to identify the input
117
  * @param boolean $checked If the input is checked or not
118
  */
119
  private function checkbox( $label, $name, $checked )
120
  {
121
- printf( '<input type="checkbox" name="%s" value="true"', $name );
 
122
  if ($checked)
123
  echo ' checked';
124
  echo ' />';
125
- echo ' '.$label.'<br/>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  }
127
  }
11
  */
12
  class Post_Snippets_Settings
13
  {
14
+ // Constants
15
+ const PLUGIN_OPTION_KEY = 'post_snippets_options';
16
+ const USER_OPTION_KEY = 'post_snippets';
17
 
 
18
 
19
+ // -------------------------------------------------------------------------
20
+ // Handle form I/O
21
+ // -------------------------------------------------------------------------
22
+
23
+ /**
24
+ * Update User Option.
25
+ *
26
+ * Sets the per user option for the read-only overview page.
27
+ *
28
+ * @since Post Snippets 1.9.7
29
+ */
30
+ private function set_user_options()
31
+ {
32
+ if ( isset($_POST['post_snippets_user_nonce']) && wp_verify_nonce( $_POST['post_snippets_user_nonce'], 'post_snippets_user_options') )
33
+ {
34
+ $id = get_current_user_id();
35
+ $render = isset( $_POST['render'] ) ? true : false;
36
+ update_user_meta( $id, self::USER_OPTION_KEY, $render );
37
+ }
38
+ }
39
+
40
+ /**
41
+ * Get User Option.
42
+ *
43
+ * Gets the per user option for the read-only overview page.
44
+ *
45
+ * @since Post Snippets 1.9.7
46
+ * @return boolean If overview should be rendered on output or not
47
+ */
48
+ private function get_user_options()
49
+ {
50
+ $id = get_current_user_id();
51
+ $options = get_user_meta( $id, self::USER_OPTION_KEY, true );
52
+ return $options;
53
+ }
54
+
55
+
56
+ // -------------------------------------------------------------------------
57
+ // HTML generation for option pages
58
+ // -------------------------------------------------------------------------
59
+
60
+ /**
61
+ * Render the options page.
62
+ *
63
+ * @since Post Snippets 1.9.7
64
+ * @param string $page Admin page to render. Default: options
65
+ */
66
+ public function render( $page )
67
  {
68
+ switch ( $page ) {
69
+ case 'options':
70
+ $this->options_page();
71
+ break;
72
+
73
+ default:
74
+ $this->overview_page();
75
+ break;
76
+ }
77
  }
78
 
79
+ /**
80
+ * Creates the snippets administration page.
81
+ *
82
+ * For users with manage_options capability (admin, super admin).
83
+ *
84
+ * @since Post Snippets 1.8.8
85
+ */
86
+ private function options_page()
87
  {
88
  ?>
89
  <div class=wrap>
122
 
123
  <tbody>
124
  <?php
125
+ $snippets = get_option( self::PLUGIN_OPTION_KEY );
 
126
  if (!empty($snippets)) {
127
  foreach ($snippets as $key => $snippet) {
128
  ?>
160
  ?>
161
  </tbody>
162
  </table>
163
+
 
 
 
164
  <?php
165
+ $this->submit( 'update-post-snippets', __('Update Snippets', 'post-snippets') );
166
+ echo '</form>';
167
+ // ---
168
+
169
+ echo '</div>';
170
  }
171
 
172
+ /**
173
+ * Creates a read-only overview page.
174
+ *
175
+ * For users with edit_posts capability but without manage_options
176
+ * capability.
177
+ *
178
+ * @since Post Snippets 1.9.7
179
+ */
180
+ private function overview_page()
181
+ {
182
+ // Header
183
+ echo '<div class=wrap>';
184
+ echo '<h2>Post Snippets</h2>';
185
+ echo '<p>';
186
+ _e( 'This is an overview of all snippets defined for this site. These snippets are inserted into posts from the post editor using the Post Snippets button. You can choose to see the snippets here as-is or as they are actually rendered on the website. Enabling rendered snippets for this overview might look strange if the snippet have dependencies on variables, CSS or other parameters only available on the frontend. If that is the case it is recommended to keep this option disabled.', 'post-snippets' );
187
+ echo '</p>';
188
+
189
+ // Form
190
+ $this->set_user_options();
191
+ $render = $this->get_user_options();
192
+
193
+ echo '<form method="post" action="">';
194
+ wp_nonce_field( 'post_snippets_user_options', 'post_snippets_user_nonce' );
195
+
196
+ $this->checkbox(__('Display rendered snippets', 'post-snippets'), 'render', $render );
197
+ $this->submit( 'update-post-snippets-user', __('Update', 'post-snippets') );
198
+ echo '</form>';
199
+
200
+ // Snippet List
201
+ $snippets = get_option( self::PLUGIN_OPTION_KEY );
202
+ if (!empty($snippets)) {
203
+ foreach ($snippets as $key => $snippet) {
204
+
205
+ echo "<hr style='border: none;border-top:1px dashed #aaa; margin:24px 0;' />";
206
+
207
+ echo "<h3>{$snippet['title']}";
208
+ if ($snippet['description'])
209
+ echo "<span class='description'> {$snippet['description']}</span>";
210
+ echo "</h3>";
211
+
212
+ if ($snippet['vars'])
213
+ printf( "<strong>%s:</strong> {$snippet['vars']}<br/>", __('Variables', 'post-snippets') );
214
+
215
+ // echo "<strong>Variables:</strong> {$snippet['vars']}<br/>";
216
+
217
+ $options = array();
218
+ if ($snippet['shortcode'])
219
+ array_push($options, 'Shortcode');
220
+ if ($snippet['php'])
221
+ array_push($options, 'PHP');
222
+ if ($snippet['wptexturize'])
223
+ array_push($options, 'wptexturize');
224
+ if ($options)
225
+ printf ( "<strong>%s:</strong> %s<br/>", __('Options', 'post-snippets'), implode(', ', $options) );
226
+
227
+ printf( "<br/><strong>%s:</strong><br/>", __('Snippet', 'post-snippets') );
228
+ if ( $render ) {
229
+ echo do_shortcode( $snippet['snippet'] );
230
+ } else {
231
+ echo "<code>";
232
+ echo nl2br( htmlspecialchars($snippet['snippet'], ENT_NOQUOTES) );
233
+ echo "</code>";
234
+ }
235
+ }
236
+ }
237
+
238
+ // Close
239
+ echo '</div>';
240
+ }
241
+
242
+
243
  // -------------------------------------------------------------------------
244
  // HTML and Form element methods
245
  // -------------------------------------------------------------------------
246
 
247
  /**
248
  * Checkbox.
249
+ *
250
  * Renders the HTML for an input checkbox.
251
  *
252
  * @param string $label The label rendered to screen
253
+ * @param string $name The unique name and id to identify the input
254
  * @param boolean $checked If the input is checked or not
255
  */
256
  private function checkbox( $label, $name, $checked )
257
  {
258
+ echo "<label for=\"{$name}\">";
259
+ printf( '<input type="checkbox" name="%1$s" id="%1$s" value="true"', $name );
260
  if ($checked)
261
  echo ' checked';
262
  echo ' />';
263
+ echo " {$label}</label><br/>";
264
+ }
265
+
266
+ /**
267
+ * Submit.
268
+ *
269
+ * Renders the HTML for a submit button.
270
+ *
271
+ * @since Post Snippets 1.9.7
272
+ * @param string $name The name that identifies the button on submit
273
+ * @param string $label The label rendered on the button
274
+ */
275
+ private function submit( $name, $label )
276
+ {
277
+ echo '<div class="submit">';
278
+ printf( '<input type="submit" name="%s" value="%s" class="button-primary" />', $name, $label );
279
+ echo '</div>';
280
  }
281
  }
languages/post-snippets-ro_RO.mo ADDED
Binary file
languages/post-snippets-ro_RO.po ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file is distributed under the same license as the Post Snippets package.
2
+ msgid ""
3
+ msgstr ""
4
+ "Project-Id-Version: Post Snippets 1.9.3\n"
5
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/post-snippets\n"
6
+ "POT-Creation-Date: 2012-02-08 16:54:26+00:00\n"
7
+ "MIME-Version: 1.0\n"
8
+ "Content-Type: text/plain; charset=UTF-8\n"
9
+ "Content-Transfer-Encoding: 8bit\n"
10
+ "PO-Revision-Date: 2012-03-07 10:57+0200\n"
11
+ "X-Poedit-Language: Romanian\n"
12
+ "X-Poedit-Country: Romania\n"
13
+ "Language-Team: Web Geeks\n"
14
+ "Last-Translator: \n"
15
+
16
+ #: classes/settings.php:33
17
+ msgid "Add New Snippet"
18
+ msgstr "Adăugare fragment nou"
19
+
20
+ #: classes/settings.php:34
21
+ msgid "Delete Selected"
22
+ msgstr "Ştergere selectate"
23
+
24
+ #: classes/settings.php:35
25
+ msgid "(Use the help dropdown button above for additional information.)"
26
+ msgstr "(Utilizaţi butonul ajutor dropdown de mai sus pentru informaţii suplimentare.)"
27
+
28
+ #: classes/settings.php:44
29
+ #: classes/settings.php:53
30
+ #: classes/help.php:91
31
+ msgid "Title"
32
+ msgstr "Titlul"
33
+
34
+ #: classes/settings.php:45
35
+ #: classes/settings.php:54
36
+ #: classes/help.php:98
37
+ msgid "Variables"
38
+ msgstr "Variabile"
39
+
40
+ #: classes/settings.php:46
41
+ #: classes/settings.php:55
42
+ #: classes/help.php:109
43
+ msgid "Snippet"
44
+ msgstr "Fragment"
45
+
46
+ #: classes/settings.php:76
47
+ #: classes/help.php:46
48
+ #: classes/help.php:258
49
+ msgid "Shortcode"
50
+ msgstr "Shortcode"
51
+
52
+ #: classes/settings.php:81
53
+ msgid "PHP Code"
54
+ msgstr "Cod PHP"
55
+
56
+ #: classes/settings.php:90
57
+ #: classes/help.php:125
58
+ msgid "Description"
59
+ msgstr "Descriere"
60
+
61
+ #: classes/settings.php:101
62
+ msgid "Update Snippets"
63
+ msgstr "Fragmente de actualizare"
64
+
65
+ #: classes/help.php:41
66
+ #: classes/help.php:256
67
+ msgid "Basic"
68
+ msgstr "Bază"
69
+
70
+ #: classes/help.php:51
71
+ #: classes/help.php:260
72
+ msgid "PHP"
73
+ msgstr "PHP"
74
+
75
+ #: classes/help.php:56
76
+ #: classes/help.php:262
77
+ msgid "Advanced"
78
+ msgstr "Avansate"
79
+
80
+ #: classes/help.php:70
81
+ msgid "For more information:"
82
+ msgstr "Pentru mai multe informaţii:"
83
+
84
+ #: classes/help.php:74
85
+ msgid "Post Snippets Documentation"
86
+ msgstr "Documentația fragmente post"
87
+
88
+ #: classes/help.php:78
89
+ msgid "Support Forums"
90
+ msgstr "Forumuri de asistenţă tehnică"
91
+
92
+ #: classes/help.php:94
93
+ msgid "Give the snippet a title that helps you identify it in the post editor. This also becomes the name of the shortcode if you enable that option"
94
+ msgstr "Da fragmentul de un titlu care vă ajută să se identifice în editorul de post. Acest lucru devine, de asemenea, numele de scurtătură, dacă activaţi această opţiune"
95
+
96
+ #: classes/help.php:101
97
+ 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."
98
+ msgstr "O separate prin virgulă listă de variabile personalizate puteţi de referinţă în fragmentul. O variabila poate fi atribuit, de asemenea, o valoare implicită, care va fi utilizat în fereastra Inserare folosind semnul egal, implicit=variabil."
99
+
100
+ #: classes/help.php:104
101
+ #: classes/help.php:115
102
+ #: classes/help.php:230
103
+ msgid "Example"
104
+ msgstr "Exemplu"
105
+
106
+ #: classes/help.php:112
107
+ msgid "This is the block of text, HTML or PHP to insert in the post or as a shortcode. If you have entered predefined variables you can reference them from the snippet by enclosing them in {} brackets."
108
+ msgstr "Acesta este blocul de text, HTML sau PHP pentru a insera în post sau ca o scurtătură. Dacă aţi introdus variabile predefinite, aveţi posibilitatea să le referinţă de la fragmentul de anexând-le în paranteze {}."
109
+
110
+ #: classes/help.php:117
111
+ msgid "To reference the variables in the example above, you would enter {url} and {name}. So if you enter this snippet:"
112
+ msgstr "Pentru a face referire la variabilele din exemplul de mai sus, ar trebui să introduceţi {url} şi {name}. Deci, dacă introduceţi acest fragment:"
113
+
114
+ #: classes/help.php:121
115
+ msgid "You will get the option to replace url and name on insert if they are defined as variables."
116
+ msgstr "Veţi obţine opţiunea de a înlocui URL-ul şi numele de pe inseraţi în cazul în care sunt definite ca variabile."
117
+
118
+ #: classes/help.php:128
119
+ msgid "An optional description for the Snippet. If filled out, the description will be displayed in the snippets insert window in the post editor."
120
+ msgstr "O descriere opţională pentru fragment. Dacă completat, descrierea va fi afişată în fereastra Inserare fragmente în editorul de post."
121
+
122
+ #: classes/help.php:141
123
+ msgid "When enabling the shortcode checkbox, the snippet is no longer inserted directly but instead inserted as a shortcode. The obvious advantage of this is of course that you can insert a block of text or code in many places on the site, and update the content from one single place."
124
+ msgstr "Când activaţi caseta de scurtătură, fragmentul nu mai este introdus direct, ci introduce ca o scurtătură.Avantajul evident al acestui curs este că puteţi insera un bloc de text sau cod, în multe locuri de pe site-ul, şi să actualizeze conţinutul dintr-un singur loc."
125
+
126
+ #: classes/help.php:145
127
+ msgid "The name to use the shortcode is the same as the title of the snippet (spaces are not allowed). When inserting a shortcode snippet, the shortcode and not the content will be inserted in the post."
128
+ msgstr "Numele de a utiliza scurtătură este acelaşi ca titlul a fragmentului (spaţiile nu sunt permise). La introducerea unui fragment scurtătură, scurtătură şi nu de conţinut se va introduce în mesaj."
129
+
130
+ #: classes/help.php:148
131
+ 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."
132
+ msgstr "Dacă vă încadraţi scurtătură în mesajele dumneavoastră, puteţi accesa conţinut închis folosind variabila {conţinut} în fragmentul.{Conţinut} variabil este rezervat, asa ca nu-l utilizaţi în domeniul variabile."
133
+
134
+ #: classes/help.php:152
135
+ msgid "Options"
136
+ msgstr "Opţiuni"
137
+
138
+ #: classes/help.php:155
139
+ msgid "See the dedicated help section for information about PHP shortcodes."
140
+ msgstr "Consultaţi secţiunea de ajutor dedicat pentru informaţii despre PHP shortcodes."
141
+
142
+ #: classes/help.php:158
143
+ 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."
144
+ msgstr "Înainte de a se scurtătură scoase, acesta poate fi formatată în mod opţional cu %s, pentru a transforma citate de citate inteligente, apostrofuri, linii, elipse, simbol al unei mărci, precum şi simbolul de multiplicare."
145
+
146
+ #: classes/help.php:171
147
+ 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."
148
+ msgstr "Fragmentele definite ca Scurtăturile pot fi opţional, de asemenea, evaluate sub formă de cod PHP, permiţând caseta PHP. PHP fragmente este disponibilă numai atunci când se tratează ca fragmentul de o scurtătură."
149
+
150
+ #: classes/help.php:174
151
+ msgid "Example PHP Snippet"
152
+ msgstr "Exemplu PHP fragment"
153
+
154
+ #: classes/help.php:183
155
+ 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:"
156
+ msgstr "Cu un fragment definit ca cea de mai sus, se poate numi cu definiţia scurtătură într-un mesaj. Să pretind că fragmentul de exemplu, este numit phpcode şi să aibă o loop_me variabilă este definită, atunci ar fi numit ca aceasta de la un mesaj:"
157
+
158
+ #: classes/help.php:189
159
+ 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!)"
160
+ msgstr "Atunci când este executat scurtătură variabila loop_me va fi înlocuit cu şirul furnizate în scurtătură şi apoi codul PHP vor fi evaluate. (Scoaterea şir de cinci ori în acest caz, Wow!)."
161
+
162
+ #: classes/help.php:192
163
+ 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 <?php #code; ?>."
164
+ msgstr "Notă ordinea de evaluare, orice variabile fragment va fi înlocuit înainte de fragmentul este evaluată ca fiind cod PHP. De asemenea, reţineţi că un fragment de PHP nu trebuie să fie ambalate în <?PHP code#;?>."
165
+
166
+ #: classes/help.php:205
167
+ msgid "You can retrieve a Post Snippet directly from PHP, in a theme for instance, by using the get_post_snippet() function."
168
+ msgstr "Puteţi prelua un fragment de mesaj direct de la PHP, într-o temă de exemplu, prin utilizarea get_post_snippet () funcţia."
169
+
170
+ #: classes/help.php:209
171
+ msgid "Usage"
172
+ msgstr "Utilizare"
173
+
174
+ #: classes/help.php:217
175
+ msgid "Parameters"
176
+ msgstr "Parametrii"
177
+
178
+ #: classes/help.php:221
179
+ msgid "(string) (required) The name of the snippet to retrieve."
180
+ msgstr "(string) (obligatoriu) Numele fragmentul pentru a prelua."
181
+
182
+ #: classes/help.php:226
183
+ msgid "(string) The variables to pass to the snippet, formatted as a query string."
184
+ msgstr "(string) Variabilele pentru a trece la fragmentul, formatat ca un şir de interogare."
185
+
186
+ #: post-snippets.php:85
187
+ msgid "Settings"
188
+ msgstr "Setări"
189
+
190
+ #: post-snippets.php:430
191
+ msgid "This snippet is insert only, no variables defined."
192
+ msgstr "Acest fragment este insera numai, nu variabilele definite."
193
+
194
+ #: post-snippets.php:577
195
+ msgid "A snippet named Untitled has been added."
196
+ msgstr "S-a adăugat un fragment numit fără titlu."
197
+
198
+ #: post-snippets.php:595
199
+ #: post-snippets.php:745
200
+ msgid "Snippets have been updated."
201
+ msgstr "Fragmente au fost actualizate."
202
+
203
+ #: post-snippets.php:611
204
+ msgid "Selected snippets have been deleted."
205
+ msgstr "Fragmente selectate au fost şterse."
206
+
207
+ #: post-snippets.php:625
208
+ msgid "Import/Export"
209
+ msgstr "Import/Export"
210
+
211
+ #: post-snippets.php:626
212
+ msgid "Export"
213
+ msgstr "Export"
214
+
215
+ #: post-snippets.php:628
216
+ msgid "Export your snippets for backup or to import them on another site."
217
+ msgstr "Export dumneavoastră fragmente de copie de rezervă sau să le importaţi pe un alt site."
218
+
219
+ #: post-snippets.php:629
220
+ msgid "Export Snippets"
221
+ msgstr "Fragmente de export"
222
+
223
+ #: post-snippets.php:715
224
+ msgid "Import"
225
+ msgstr "Import"
226
+
227
+ #: post-snippets.php:717
228
+ msgid "Import snippets from a post-snippets-export.zip file. Importing overwrites any existing snippets."
229
+ msgstr "Fragmente de import dintr-un fişier post-fragmente-export.zip. Importul suprascrie orice fragmente existente."
230
+
231
+ #: post-snippets.php:721
232
+ msgid "Import Snippets"
233
+ msgstr "Fragmente de import"
234
+
235
+ #: post-snippets.php:747
236
+ msgid "Snippets successfully imported."
237
+ msgstr "Fragmente importate cu succes."
238
+
239
+ #: post-snippets.php:749
240
+ #: post-snippets.php:753
241
+ #: post-snippets.php:755
242
+ msgid "Snippets could not be imported:"
243
+ msgstr "Fragmente nu ar putea fi importate:"
244
+
245
+ #: post-snippets.php:749
246
+ msgid "Unzipping failed."
247
+ msgstr "Unzipping nu a reuşit."
248
+
249
+ #: post-snippets.php:755
250
+ msgid "Upload failed."
251
+ msgstr "Încărcaţi nu a reuşit."
252
+
253
+ #. Plugin Name of the plugin/theme
254
+ msgid "Post Snippets"
255
+ msgstr "Fragmente post"
256
+
257
+ #. Plugin URI of the plugin/theme
258
+ msgid "http://wpstorm.net/wordpress-plugins/post-snippets/"
259
+ msgstr "http://wpstorm.net/Wordpress-plugins/post-Snippets/"
260
+
261
+ #. Description of the plugin/theme
262
+ 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."
263
+ msgstr "Construieste o bibliotecă, cu fragmente de cod HTML, codul PHP sau textul reoccurring pe care le utilizaţi frecvent în mesajele dumneavoastră. Variabile pentru a înlocui părţi ale fragmentul pe Inserare poate fi utilizat.Fragmente poate fi introdus ca-ca este sau scurte."
264
+
265
+ #. Author of the plugin/theme
266
+ msgid "Johan Steen"
267
+ msgstr "Johan Steen"
268
+
269
+ #. Author URI of the plugin/theme
270
+ msgid "http://johansteen.se/"
271
+ msgstr "http://johansteen.se/"
272
+
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.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"
@@ -12,50 +12,14 @@ msgstr ""
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
- #: classes/settings.php:33
16
- msgid "Add New Snippet"
17
- msgstr ""
18
-
19
- #: classes/settings.php:34
20
- msgid "Delete Selected"
21
- msgstr ""
22
-
23
- #: classes/settings.php:35
24
- msgid "(Use the help dropdown button above for additional information.)"
25
- msgstr ""
26
-
27
- #: classes/settings.php:44 classes/settings.php:53 classes/help.php:91
28
- msgid "Title"
29
- msgstr ""
30
-
31
- #: classes/settings.php:45 classes/settings.php:54 classes/help.php:98
32
- msgid "Variables"
33
- msgstr ""
34
-
35
- #: classes/settings.php:46 classes/settings.php:55 classes/help.php:109
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 ""
@@ -76,12 +40,21 @@ msgstr ""
76
  msgid "Support Forums"
77
  msgstr ""
78
 
 
 
 
 
79
  #: classes/help.php:94
80
  msgid ""
81
  "Give the snippet a title that helps you identify it in the post editor. This "
82
  "also becomes the name of the shortcode if you enable that option"
83
  msgstr ""
84
 
 
 
 
 
 
85
  #: classes/help.php:101
86
  msgid ""
87
  "A comma separated list of custom variables you can reference in your "
@@ -93,6 +66,11 @@ msgstr ""
93
  msgid "Example"
94
  msgstr ""
95
 
 
 
 
 
 
96
  #: classes/help.php:112
97
  msgid ""
98
  "This is the block of text, HTML or PHP to insert in the post or as a "
@@ -112,6 +90,10 @@ msgid ""
112
  "defined as variables."
113
  msgstr ""
114
 
 
 
 
 
115
  #: classes/help.php:128
116
  msgid ""
117
  "An optional description for the Snippet. If filled out, the description will "
@@ -140,7 +122,7 @@ msgid ""
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
 
@@ -211,69 +193,108 @@ msgid ""
211
  "(string) The variables to pass to the snippet, formatted as a query string."
212
  msgstr ""
213
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  #: post-snippets.php:85
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
 
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.6\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/post-snippets\n"
7
+ "POT-Creation-Date: 2012-03-21 09:28:13+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
15
+ #: classes/help.php:41 classes/help.php:256
16
+ msgid "Basic"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  msgstr ""
18
 
19
+ #: classes/help.php:46 classes/help.php:258 classes/settings.php:146
20
  msgid "Shortcode"
21
  msgstr ""
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  #: classes/help.php:51 classes/help.php:260
24
  msgid "PHP"
25
  msgstr ""
40
  msgid "Support Forums"
41
  msgstr ""
42
 
43
+ #: classes/help.php:91 classes/settings.php:114 classes/settings.php:123
44
+ msgid "Title"
45
+ msgstr ""
46
+
47
  #: classes/help.php:94
48
  msgid ""
49
  "Give the snippet a title that helps you identify it in the post editor. This "
50
  "also becomes the name of the shortcode if you enable that option"
51
  msgstr ""
52
 
53
+ #: classes/help.php:98 classes/settings.php:115 classes/settings.php:124
54
+ #: classes/settings.php:219
55
+ msgid "Variables"
56
+ msgstr ""
57
+
58
  #: classes/help.php:101
59
  msgid ""
60
  "A comma separated list of custom variables you can reference in your "
66
  msgid "Example"
67
  msgstr ""
68
 
69
+ #: classes/help.php:109 classes/settings.php:116 classes/settings.php:125
70
+ #: classes/settings.php:233
71
+ msgid "Snippet"
72
+ msgstr ""
73
+
74
  #: classes/help.php:112
75
  msgid ""
76
  "This is the block of text, HTML or PHP to insert in the post or as a "
90
  "defined as variables."
91
  msgstr ""
92
 
93
+ #: classes/help.php:125 classes/settings.php:160
94
+ msgid "Description"
95
+ msgstr ""
96
+
97
  #: classes/help.php:128
98
  msgid ""
99
  "An optional description for the Snippet. If filled out, the description will "
122
  "variable is reserved, so don't use it in the variables field."
123
  msgstr ""
124
 
125
+ #: classes/help.php:152 classes/settings.php:231
126
  msgid "Options"
127
  msgstr ""
128
 
193
  "(string) The variables to pass to the snippet, formatted as a query string."
194
  msgstr ""
195
 
196
+ #: classes/settings.php:103
197
+ msgid "Add New Snippet"
198
+ msgstr ""
199
+
200
+ #: classes/settings.php:104
201
+ msgid "Delete Selected"
202
+ msgstr ""
203
+
204
+ #: classes/settings.php:105
205
+ msgid "(Use the help dropdown button above for additional information.)"
206
+ msgstr ""
207
+
208
+ #: classes/settings.php:151
209
+ msgid "PHP Code"
210
+ msgstr ""
211
+
212
+ #: classes/settings.php:172
213
+ msgid "Update Snippets"
214
+ msgstr ""
215
+
216
+ #: classes/settings.php:193
217
+ msgid ""
218
+ "This is an overview of all snippets defined for this site. These snippets "
219
+ "are inserted into posts from the post editor using the Post Snippets button. "
220
+ "You can choose to see the snippets here as-is or as they are actually "
221
+ "rendered on the website. Enabling rendered snippets for this overview might "
222
+ "look strange if the snippet have dependencies on variables, CSS or other "
223
+ "parameters only available on the frontend. If that is the case it is "
224
+ "recommended to keep this option disabled."
225
+ msgstr ""
226
+
227
+ #: classes/settings.php:202
228
+ msgid "Display rendered snippets"
229
+ msgstr ""
230
+
231
+ #: classes/settings.php:203
232
+ msgid "Update"
233
+ msgstr ""
234
+
235
  #: post-snippets.php:85
236
  msgid "Settings"
237
  msgstr ""
238
 
239
+ #: post-snippets.php:458
240
  msgid "This snippet is insert only, no variables defined."
241
  msgstr ""
242
 
243
+ #: post-snippets.php:626
244
  msgid "A snippet named Untitled has been added."
245
  msgstr ""
246
 
247
+ #: post-snippets.php:644 post-snippets.php:797
248
  msgid "Snippets have been updated."
249
  msgstr ""
250
 
251
+ #: post-snippets.php:660
252
  msgid "Selected snippets have been deleted."
253
  msgstr ""
254
 
255
+ #: post-snippets.php:674
256
  msgid "Import/Export"
257
  msgstr ""
258
 
259
+ #: post-snippets.php:675
260
  msgid "Export"
261
  msgstr ""
262
 
263
+ #: post-snippets.php:677
264
  msgid "Export your snippets for backup or to import them on another site."
265
  msgstr ""
266
 
267
+ #: post-snippets.php:678
268
  msgid "Export Snippets"
269
  msgstr ""
270
 
271
+ #: post-snippets.php:765
272
  msgid "Import"
273
  msgstr ""
274
 
275
+ #: post-snippets.php:767
276
  msgid ""
277
  "Import snippets from a post-snippets-export.zip file. Importing overwrites "
278
  "any existing snippets."
279
  msgstr ""
280
 
281
+ #: post-snippets.php:771
282
  msgid "Import Snippets"
283
  msgstr ""
284
 
285
+ #: post-snippets.php:799
286
  msgid "Snippets successfully imported."
287
  msgstr ""
288
 
289
+ #: post-snippets.php:801 post-snippets.php:805 post-snippets.php:807
290
  msgid "Snippets could not be imported:"
291
  msgstr ""
292
 
293
+ #: post-snippets.php:801
294
  msgid "Unzipping failed."
295
  msgstr ""
296
 
297
+ #: post-snippets.php:807
298
  msgid "Upload failed."
299
  msgstr ""
300
 
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.6
7
  Author: Johan Steen
8
  Author URI: http://johansteen.se/
9
  Text Domain: post-snippets
@@ -100,7 +100,7 @@ class Post_Snippets {
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
 
@@ -574,9 +574,15 @@ function edOpenPostSnippets(myField) {
574
  * The Admin Page and all it's functions
575
  */
576
  function wp_admin() {
577
- $option_page = add_options_page( 'Post Snippets Options', 'Post Snippets', 'administrator', $this->get_FILE(), array(&$this, 'options_page') );
578
- if ( $option_page and class_exists('Post_Snippets_Help') ) {
579
- $help = new Post_Snippets_Help( $option_page );
 
 
 
 
 
 
580
  }
581
  }
582
 
@@ -588,6 +594,20 @@ function edOpenPostSnippets(myField) {
588
  }
589
  }
590
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
591
  function options_page() {
592
  // Add a new Snippet
593
  if (isset($_POST['add-snippet'])) {
@@ -646,8 +666,7 @@ function edOpenPostSnippets(myField) {
646
 
647
  // Render the settings screen
648
  $settings = new Post_Snippets_Settings();
649
- $settings->set_options( get_option($this->plugin_options) );
650
- $settings->render();
651
 
652
  ?>
653
  <h3><?php _e( 'Import/Export', 'post-snippets' ); ?></h3>
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.7
7
  Author: Johan Steen
8
  Author URI: http://johansteen.se/
9
  Text Domain: post-snippets
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, '2.0' );
104
  wp_enqueue_style( 'post-snippets' );
105
  }
106
 
574
  * The Admin Page and all it's functions
575
  */
576
  function wp_admin() {
577
+ if ( current_user_can('manage_options') ) {
578
+ // If user can manage options, display the admin page
579
+ $option_page = add_options_page( 'Post Snippets Options', 'Post Snippets', 'administrator', $this->get_FILE(), array(&$this, 'options_page') );
580
+ if ( $option_page and class_exists('Post_Snippets_Help') ) {
581
+ $help = new Post_Snippets_Help( $option_page );
582
+ }
583
+ } else {
584
+ // If user can't manage options, but can edit posts, display the overview page
585
+ $option_page = add_options_page( 'Post Snippets', 'Post Snippets', 'edit_posts', $this->get_FILE(), array(&$this, 'overview_page') );
586
  }
587
  }
588
 
594
  }
595
  }
596
 
597
+ /**
598
+ * The options Overview page.
599
+ *
600
+ * For users without manage_options cap but with edit_posts cap. A read-only
601
+ * view.
602
+ *
603
+ * @since Post Snippets 1.9.7
604
+ */
605
+ public function overview_page() {
606
+ $settings = new Post_Snippets_Settings();
607
+ $settings->render( 'overview' );
608
+ }
609
+
610
+
611
  function options_page() {
612
  // Add a new Snippet
613
  if (isset($_POST['add-snippet'])) {
666
 
667
  // Render the settings screen
668
  $settings = new Post_Snippets_Settings();
669
+ $settings->render( 'options' );
 
670
 
671
  ?>
672
  <h3><?php _e( 'Import/Export', 'post-snippets' ); ?></h3>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: artstorm
3
  Tags: post, admin, snippet, shortcode, html, custom, page, dynamic, editor, php, code
4
  Requires at least: 3.0
5
  Tested up to: 3.3.1
6
- Stable tag: 1.9.6
7
 
8
  Keep a snippet library of text, HTML or PHP code to be used in posts. Variables
9
  can be set for more flexibility. Inserts directly or as shortcodes.
@@ -92,6 +92,17 @@ for questions, answers, support and feature requests.
92
 
93
  == Changelog ==
94
 
 
 
 
 
 
 
 
 
 
 
 
95
  = Version 1.9.6 - 19 Mar 2012 =
96
  * Added two new filters. `post_snippets_import` and `post_snippets_export`.
97
  [Read more](http://wpstorm.net/wordpress-plugins/post-snippets/#filters).
3
  Tags: post, admin, snippet, shortcode, html, custom, page, dynamic, editor, php, code
4
  Requires at least: 3.0
5
  Tested up to: 3.3.1
6
+ Stable tag: 1.9.7
7
 
8
  Keep a snippet library of text, HTML or PHP code to be used in posts. Variables
9
  can be set for more flexibility. Inserts directly or as shortcodes.
92
 
93
  == Changelog ==
94
 
95
+ = Version 1.9.7 - 22 Mar 2012 =
96
+ * Updated the styling for the snippet insert window in the post editor. This
97
+ fixes the visual glitch with tabs spanning multiple rows.
98
+ * Users without `manage_options` but with `edit_posts` capability (authors,
99
+ contributors, editors)can now see a read-only list of available snippets and
100
+ related info.
101
+ * Users with read-only access can toggle if they want to see their snippets
102
+ overview as rendered output or as-is.
103
+ * Enabled `label for=` with checkboxes.
104
+ * Included Romanian translation by Web Hosting Geeks.
105
+
106
  = Version 1.9.6 - 19 Mar 2012 =
107
  * Added two new filters. `post_snippets_import` and `post_snippets_export`.
108
  [Read more](http://wpstorm.net/wordpress-plugins/post-snippets/#filters).
uninstall.php CHANGED
@@ -1,8 +1,21 @@
1
  <?php
2
- /**
3
- * Uninstall
4
- * Clean up the WP DB by deleting the options created by the plugin.
5
- *
6
- */
 
 
7
  delete_option('post_snippets_options');
8
- ?>
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
+ /**
3
+ * Uninstall.
4
+ * Clean up the WP DB by deleting the options created by the plugin.
5
+ */
6
+ function post_snippets_uninstall()
7
+ {
8
+ // Delete all snippets
9
  delete_option('post_snippets_options');
10
+
11
+ // Delete any per user settings
12
+ global $wpdb;
13
+ $wpdb->query(
14
+ "
15
+ DELETE FROM $wpdb->usermeta
16
+ WHERE meta_key = 'post_snippets'
17
+ "
18
+ );
19
+ }
20
+
21
+ post_snippets_uninstall();