PluginProbe
Snippet Shortcodes / 4.2.2
Snippet Shortcodes v4.2.2
5.2.1 5.2 5.1.8 5.1.6 5.1.7 5.1.5 trunk 1.0 1.1 1.2 1.3 1.3.1 1.4 1.5 1.5.1 1.6 1.6.1 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.8 2.0 2.0.1 All 74 releases
shortcode-variables / readme.txt

readme.txt in Snippet Shortcodes 4.2.2, at readme.txt

430 lines 18.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 === Snippet Shortcodes ===
2 Contributors: aliakro
3 Donate link: https://www.paypal.me/yeken
4 Tags: shortcode, variable, php, text, html, parameter, javascript, embed, reuse
5 Requires at least: 6.0
6 Tested up to: 6.8
7 Stable tag: 4.2.2
8 Requires PHP: 7.4
9 License: GPLv2 or later
10 License URI: http://www.gnu.org/licenses/gpl-2.0.html
11 Donate Link: https://www.paypal.me/yeken
12
13 Create your own shortcodes and assign text, html, etc to them. Use these across your site and only change in one place - saving time and effort!
14
15 == Description ==
16
17 = DOCUMENTATON / UPGRADE =
18
19 [Snippet Shortcodes Website](https://snippet-shortcodes.yeken.uk/ "Snippet Shortcodes Website")
20
21 = WHAT IS SNIPPET SHORTCODES? =
22
23 Do you want to use the same snippet of text or HTML throughout your site but only have to change the value in one location? If so, this plugin maybe just what you need.
24
25 Create your own Shortcodes and assign content to them. Using the standard WP editor, you can add text, HTML, JavaScript, images or other elements that your WordPress install and plugins allow. The main advantage is ability to create a shortcode once and re-use it throughout your site.
26
27 [ sv slug="your-slug-name"]
28
29 = FEATURES =
30
31 * Create a shortcode once and place in multiple locations.
32 * Update the shortcode in one location and it changes throughout your site.
33 * Parameters to extend your shortcodes.
34 * Free and Premium helper shortcodes to make life easier.
35 * Multi-site support.
36 * Process shortcodes within WordPress menu titles.
37
38 = SPECIFY PARAMETERS =
39
40 In some cases you may wish to make your shortcodes more extendable. This is where parameters come in. For example, you may have a shortcode that renders a HTML table, however, depending on where you place that shortcode on your site, you may wish to specify additional arguments. Take the example below, you can see the additional arguments passed into shortcode, “border”, “background” etc.
41
42 [ sv slug="render-table" border="0" background="#FFFFFF" width="50%" site-title="YeKen"]
43
44 Each argument can be rendered into the shortcode in the with the following syntax %%background%%, %%width%%, etc. Below is an example:
45
46 <table border=”%%border%%” style=”background:%%background%%” width=”%%width%%”>
47 <tr>
48 <td>Welcome to our site, %%site-title%%.</td>
49 </tr>
50 </table>
51
52 **Premium Shortcodes**
53
54 The plugin comes with the following premium shortcodes:
55
56 - sc-date - A shortcode that displays today's date with the ability to add or subtract days, months and years. To specify an interval to add or subtract onto the date use the parameter "interval" e.g. [sv slug="sc-date" interval="-1 year"], [sv slug="sc-date" interval="+5 days"], [sv slug="sc-date" interval="+3 months"]. Intervals are based upon PHP intervals and are outlined here <a href="https://www.php.net/manual/en/dateinterval.createfromdatestring.php" target="_blank">https://www.php.net/manual/en/dateinterval.createfromdatestring.php</a>. Default is UK format (DD/MM/YYYY). Format can be changed by adding the parameter format="m/d/Y" onto the shortcode. Format syntax is based upon PHP date: <a href="http://php.net/manual/en/function.date.php" target="_blank">http://php.net/manual/en/function.date.php</a>
57 - sc-db-value-by-id - A shortcode that fetches a value from the given MySQL table. Specify which column the value should be fetched from as well as specify which column should be matched against for the given key.
58 - sc-site-language - Language code for the current site
59 - sc-site-description - Site tagline (set in Settings > General)
60 - sc-site-wp-url - The WordPress address (URL) (set in Settings > General)
61 - sc-site-charset - The "Encoding for pages and feeds" (set in Settings > Reading)
62 - sc-site-wp-version - The current WordPress version
63 - sc-site-html-type - The content-type (default: "text/html"). Themes and plugins
64 - sc-site-stylesheet-url - URL to the stylesheet for the active theme.
65 - sc-site-stylesheet_directory - Directory path for the active theme.
66 - sc-site-template-url - The URL of the active theme's directory.
67 - sc-site-current-url - The current URL.
68 - sc-site-register-url - The URL to the WordPress registration page.
69 - sc-site-pingback-url - The pingback XML-RPC file URL (xmlrpc.php)
70 - sc-site-atom-feed - The Atom feed URL (/feed/atom)
71 - sc-site-rdf-url - The RDF/RSS 1.0 feed URL (/feed/rfd)
72 - sc-site-rss-url - The RSS 0.92 feed URL (/feed/rss)
73 - sc-site-rss2-url - The RSS 2.0 feed URL (/feed)
74 - sc-site-comments-atom-url - The comments Atom feed URL (/comments/feed)
75 - sc-site-comments-rss2-url - The comments RSS 2.0 feed URL (/comments/feed)
76 - sc-php-server-info - Display data from the PHP $_SERVER global e.g. [sv slug="sc-server-info" field="SERVER_SOFTWARE"]. <a href="http://php.net/manual/en/reserved.variables.server.php" rel="noopener" target="_blank">Allowed values for field attribute</a>.
77 - sc-php-unique-id - Generate a unique ID. Based upon <a href="http://php.net/manual/en/function.uniqid.php" rel="noopener" target="_blank">uniqid()</a>. If you wish the unique ID to be prefixed, add a the prefix attribute e.g. [sv slug="sc-php-unique-id" prefix="yeken"]
78 - sc-php-timestamp - Display the current unix timestamp. Based upon <a href="http://php.net/manual/en/function.time.php" rel="noopener" target="_blank">time()</a>.
79 - sc-php-random-number - Display a random number. Based upon <a href="http://php.net/manual/en/function.rand.php" rel="noopener" target="_blank">rand()</a>. It also supports the optional arguments of min and max e.g. [sv slug="sc-php-random-number" min="5" max="20" ]
80 - sc-php-random-string - Display a random string of characters. It also supports the optional argument of "length". This specifies the number of characters you wish to display (default is 10) [sv slug="sc-php-random-string" length="15"]
81 - sc-php-post-value - Display a value from the $_POST array. The "key" arguments specifies which array value to render. It also supports the optional arguments of "default". If there is no value in the array for the given "key" then the "default" will be displayed. [sv slug="sc-php-post-value" key="username" default="Not Found"]
82 - sc-php-get-value - Display a value from the $_GET array. The "key" arguments specifies which array value to render. It also supports the optional arguments of "default". If there is no value in the array for the given "key" then the "default" will be displayed. [sv slug="sc-php-get-value" key="username" default="Not Found"]
83 - sc-php-info - Display PHP Info
84 - sc-post-id - Display ID for the current post.
85 - sc-post-author - Display the author's display name or ID. The optional argument "field" allows you to specify whether you wish to display the author's "display-name" or "id". [sv slug="sc-post-author" field="id" ]
86 - sc-post-counts - Display a count of posts for certain statuses. Using the argument status, specify whether to return a count for all posts that have a status of "publish" (default), "future", "draft", "pending" or "private". [sv slug="sc-post-counts" status="draft"]
87 - sc-user-counts - Display a count of all WordPress users or the number of WordPress users for a given role e.g. [sv slug="sc-user-counts" role="subscriber"] or [sv slug="sc-user-counts"].
88 - sc-user-profile-photo - Display the WordPress profile photo for the logged in user e.g. [sv slug="sc-user-profile-photo" width="150"] or [sv slug="sc-user-profile-photo"]. Please note, width defaults to 96px.
89
90 **Free Shortcodes**
91
92 The plugin comes with the following free shortcodes:
93
94 - sc-todays-date - Displays today's date. Default is UK format (DD/MM/YYYY). Format can be changed by adding the parameter format="m/d/Y" onto the shortcode. Format syntax is based upon PHP date: <a href="http://php.net/manual/en/function.date.php" target="_blank">http://php.net/manual/en/function.date.php</a>
95 - sc-user-ip - Display the current user's IP address.
96 - sc-user-agent - Display the current user's User Agent
97 - sc-site-url - The Site address (URL) (set in Settings > General)
98 - sc-site-title - Displays the site title.
99 - sc-admin-email - Admin email (set in Settings > General)
100 - sc-page-title - Displays the page title.
101 - sc-login-page - Wordpress login page. Add the parameter "redirect" to specify where the user is taken after a successful login e.g. redirect="http://www.google.co.uk".
102 - sc-privacy-url - Displays the privacy page URL.
103 - sc-username - Display the logged in username.
104 - sc-user-id - Display the current user's ID.
105 - sc-user-email - Display the current user's email address.
106 - sc-first-name - Display the current user's username.
107 - sc-last-name - Display the current user's last name.
108 - sc-display-name - Display the current user's display name.
109
110 **Features**
111
112 - Insert the same piece of data, HTML, text, etc throughout your site and change in only one place.
113 - TinyMCE editor
114 - Place other WordPress shortcodes within yours
115 - Comes with a range of pre-made shortcodes
116 - Pass your own parameters into a shortcode
117
118 * Developed by YeKen.uk *
119
120 Paypal Donate: email@YeKen.uk
121
122 == Installation ==
123
124 1. Login into Wordpress Admin Panel
125 2. Goto Plugins > Add New
126 3. Search for "Snippet Shortcodes"
127 4. Click Install now and activate plugin
128 5. Goto Settings > Snippet Shortcodes
129
130 == Frequently Asked Questions ==
131
132 = How do I add / edit / delete Snippet Shortcodes =
133
134 Login into Wordpress Admin Panel and goto Settings > Snippet Shortcodes
135
136 == Screenshots ==
137
138 1. View all Snippet Shortcodes created.
139 2. Add a new Snippet Shortcode
140 3. Edit an existing Snippet Shortcode
141 4. Using the Snippet Shortcodes into a page
142 5. Snippet Shortcodes rendered in a page
143
144 == Upgrade Notice ==
145
146 4.1 -[sv slug="sc-db-value-by-id"], new Premium shortcode for fetching a value from a MySQL table.
147
148 == Changelog ==
149
150 = 4.2.2 =
151
152 * Version bump for WP 6.8 compatibility.
153
154 = 4.2 =
155
156 * New feature: Added Premium shortcode for displaying WooComerce user fields. Read more: https://snippet-shortcodes.yeken.uk/shortcodes/sc-woocommerce
157 * New feature: Added Premium shortcode for displaying WordPress meta fields. Read more: https://snippet-shortcodes.yeken.uk/shortcodes/sc-user-meta
158
159 = 4.1.7 =
160
161 * Improvement: Added additional security checks to Ajax handlers.
162
163 = 4.1.6 =
164
165 * New Feature: Extended [sv slug="sc-db-value-by-id"] shortcode to include the new argument "key-query-string". This allows a key to be read from the matching querystring value. Read more: https://snippet-shortcodes.yeken.uk/shortcodes/sc-db-value-by-id.html
166
167 = 4.1.5 =
168
169 * Maintenance: Added a nonce to the main admin Add/Edit UI screen. Although the form was on an admin screen and not exposed to the public, it doesn't hurt to add a nonce as well. Thanks Benedictus Jovan (aillesiM).
170
171 = 4.1.4 =
172
173 * Maintenance: Updated tested with WP 6.5 note.
174
175 = 4.1.3 =
176
177 * Bug fix: Fixed incorrect reference to ws_ls_to_bool() with sh_cd_to_bool()
178
179 = 4.1.2 =
180
181 * Improvement: By default, the shortcode [sv slug="sc-db-value-by-id"] shall be disabled unless explicitly enabled in WP Admin.
182 * Improvement: Added the setting ''"sc-db-value-by-id" shortcode enabled?' to enable the shortcode [sv slug="sc-db-value-by-id"].
183 * Improvement: Added filter "disable-ss-sc-db-value-by-id" to hard disable the shortcode [sv slug="sc-db-value-by-id"].
184
185 = 4.1.1 =
186
187 * Improvement: Dropped the database table prefix from the shortcode [sv slug="sc-db-value-by-id"] e.g. instead of specifying "users" table, it would now be "wp_users" (i.e. if a WP table, specify the prefix)
188
189 = 4.1 =
190
191 * New Feature: New Premium shortcode for fetching a value from a MySQL table, [sv slug="sc-db-value-by-id"]. Read more: https://snippet-shortcodes.yeken.uk/shortcodes/sc-db-value-by-id.html
192
193 = 4.0.4 =
194
195 * Bug fix: Added extra error handling around no multisite tags.
196
197 = 4.0.3 =
198
199 * Updated "Tested upto" statement.
200
201 = 4.0.2 =
202
203 * Tested up to version 6.0.
204
205 = 4.0.1 =
206
207 * Updated "Tested upto" WP version.
208
209 = 4.0 =
210
211 * New feature: Bulk import of shortcodes via CSV.
212 * New feature: Quick Add shortcodes without having to open the editor and wait for page refreshes.
213 * Improvement: Shortcodes can be deleted via Ajax on the list page. This saves waiting for a page refresh.
214 * Improvement: Added "loading" animations on relevant UI elements.
215 * Improvement: General code refactoring.
216 * Bug fix: Allowed text in JS files to be correctly localised.
217
218 = 3.5.4 =
219
220 * Updated version WP compatibility statement.
221
222 = 3.5.3 =
223
224 * Updated version WP compatibility statement.
225
226 = 3.5.2 =
227
228 * Version bump.
229
230 = 3.5.1 =
231
232 * Bug fix: Corrected documentation and GitHub issue links.
233 * Added a little text about emailing in suggestions.
234
235 = 3.5 =
236
237 * New Feature: New settings page.
238 * New Feature: Allow authors and editors to view and edit your shortcodes.
239
240 = 3.4.1 =
241
242 * Bug fix: Fixed issue with saving.
243
244 = 3.4 =
245
246 * Improvement: Cosmetic tweaks to shortcode list table.
247 * Bug fix: Fixed an issue where license price wasn't being displayed correctly.
248 * Change: Updated links to new documentation website: https://snippet-shortcodes.yeken.uk/
249 * Change: Free users are now limited to 15 shortcodes.
250 * Change: Tweaked Upgrade URL and default price.
251
252 = 3.3.3 =
253
254 * Updated "Tested upto" statement within readme.txt.
255
256 = 3.3.2 =
257
258 * Renamed plugin to Snippet Shortcodes!
259
260 = 3.3.1 =
261
262 * Updated tested upto version for 5.6
263
264 = 3.3 =
265
266 * Improvement: Removed "Your shortcode has been saved" confirmation page.
267
268 = 3.2.1 =
269
270 * Readme tweaks.
271
272 = 3.2 =
273
274 * New Shortcode: "sc-user-profile-photo" - display the current user's profile photo.
275
276 = 3.1.1 =
277
278 * Updated compatibility version number.
279
280 = 3.1 =
281
282 * New Shortcode: "sc-site-current-url" - get the current URL.
283 * New Shortcode: "sc-site-register-url" - get the URL for the WordPress registration page.
284 * Improvement: Added localised strings so plugin can now be translated.
285 * Improvement: Licenses are now checked daily and on each upgrade to ensure they are still valid.
286 * Bug fix: Missing array element throwing error on shortcode listing page.
287 * Bug fix: PHP warning being thrown on license page when one hasn't been added.
288 * Bug fix: Always create multisite database table regardless.
289
290 = 3.0.4 =
291
292 * Improvement: Fetch license price from YeKen API
293
294 = 3.0.3 =
295
296 * Bug fix: Removed debug data altogether as causing unintended behaviour.
297
298 = 3.0.2 =
299
300 * Bug fix: Only display HTML caching comment on pages / posts. Currently rendering on things like AJAX responses and causing unintended behaviour.
301
302 = 3.0.1 =
303
304 * Bug fix: Fix error being thrown when not a multi site and DB table missing.
305
306 = 3.0 =
307
308 * Improvement: Support for multi-site variables.
309 * Improvement: Replace shortcodes within menu titles.
310
311 = 2.4.1 =
312
313 * Bug fix: fixed save_result undeclared variable error.
314
315 = 2.4 =
316
317 * New Feature: Added a button to the WordPress text editor (classic mode) to allow users to easily insert shortcodes.
318 * New Fetaure: Added a new shortcode sc-date. Allows you to do render today's date and add or subtract days, months and years.
319
320 = 2.3 =
321
322 * Improvement: sc-user-counts - Display a count of all WordPress users or the number of WordPress users for a given role e.g. [sv slug="sc-user-counts" role="subscriber"] or [sv slug="sc-user-counts"].
323
324 = 2.2.1 =
325
326 * Bug fix: Fixed issue with clone.
327
328 = 2.2 =
329
330 * Improvement: Slugs can now be edited.
331
332 = 2.1 =
333
334 * New Feature: Added the ability to clone your own shortcodes.
335
336 = 2.0.1 =
337
338 * Bug fix: Fixed broken menu
339
340 = 2.0 =
341
342 * New Feature: Added additional premium shortcodes.
343 * New Feature: Inline editing of shortcodes from the main list screen.
344 * New Feature: Able to disable / enable shortcodes from shortcode list.
345 * Improvement: Refactoring and optimisation of the entire plugin code.
346 * Improvement: Added Fooicons.
347 * Improvement: Added simple form validation when adding a record.
348
349 = 1.8 =
350
351 * Improvement: Added escaping for premade shortcodes.
352 * Improvement: Added new shortcode "sc-privacy-url" for rendering Privacy URL link.
353
354 = 1.7.4 =
355
356 - Version and readme.txt updated to reflect 4.8 compatibility.
357
358 = 1.7.3 =
359
360 - BUG FIX: On the very first load of a variable it would return nothing. This was due to a bug in the code. The first load would display nothing to the user, however it would cache the shortcode correctly. Upon the next visit, the shortcode would render correctly!
361
362 = 1.7.2 =
363
364 - When creating a new shortcode, "Disabled" is set by default to "No".
365 - Additional upgrade check added. This compares the previously stored version number against the new version number. If there is a difference, it will run the DB table check again.
366
367 = 1.7.1 =
368
369 - BUG FIX: Tweak made to "on activate" so the code required to change the relevant database tables is called correctly.
370
371 = 1.7 =
372
373 - Disable a variable. You can now disable a variable via the admin panel - if a shortcode is disabled nothing will be rendered in it's place (will remove the shortcode though).
374
375 = 1.6.1 =
376
377 - BUG FIX: Array declaration caused 500 error on non PHP 7
378
379 = 1.6 =
380
381 - Now supports custom parameters. You can now add parameters when inserting a shortcode and specify where in the shortcode those parameters should appear.
382 - BUG FIX: Removed a stray var_dump()
383
384 = 1.5.1 =
385
386 * BUG FIX: "Add new" link for message "You haven't created any shortcodes yet." wasn't working correctly
387 * BUG FIX: Typo - "Shotcodes" instead of "Shortcodes" on "Your Shortcodes" page
388
389 = 1.5 =
390
391 * Added a shorter shortcode slug. So, instead of [shortcode-variables slug="your-slug-name"] you can also use [s-var slug="your-slug-name"]
392 * BUG FIX: Some pre-made shortcodes weren't being rendered in the correct place. Fixed.
393
394 = 1.4 =
395 * Added the new pre-made shortcodes:
396 * sc-login-page - Wordpress login page. Add the parameter "redirect" to specify where the user is taken after a successful login e.g. redirect="http://www.google.co.uk".
397 * sc-username - Display the logged in username.
398 * sc-user-id - Display the current user's ID
399 * sc-user-ip - Display the current user's IP address.
400 * sc-user-email - Display the current user's email address.
401 * sc-username - Display the current user's username.
402 * sc-first-name - Display the current user's first name.
403 * sc-last-name - Display the current user's last name.
404 * sc-display-name - Display the current user's display name.
405 * sc-user-agent - Display the current user's user agent
406 * BUG FIX: Deleting a shortcode from cache when deleted from Admin panel. This stops it getting rendered when removed from the plugin.
407
408 = 1.3.1 =
409
410 * Added some messages to encourage people to suggest premade tags.
411 * Added version numbers. These are stored in DB to aid future upgrades.
412
413 = 1.3 =
414
415 This was a dummy release to fix an SVN issue with the 1.2 release!
416
417 = 1.2 =
418
419 * Added Premade shortcodes and framework to add additional ones
420 * Added Top Level menu item to support two sub pages. One for user defined shortcodes and another for premade shortcodes.
421
422 = 1.1 =
423 * Added caching to SQL queries. Therefore making shortcode rendering faster and reduce load on mySQL.
424 * TinyMCE editor for editing shortcode content.
425 * You can now specify other shortcodes within your Snippet Shortcodes.
426 * Readme.txt fixes
427
428 = 1.0 =
429 * Initial Release
430