| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 3 |
?> |
| 4 |
|
| 5 |
<h2><?php _e('Usage', 'post-snippets'); ?></h2> |
| 6 |
|
| 7 |
|
| 8 |
<h3><?php _e('Title', 'post-snippets'); ?></h3> |
| 9 |
<p> |
| 10 |
<?php _e('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.', 'post-snippets'); ?> |
| 11 |
</p> |
| 12 |
|
| 13 |
|
| 14 |
<h3><?php _e('Variables', 'post-snippets'); ?></h3> |
| 15 |
<p> |
| 16 |
<?php _e('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.', 'post-snippets'); ?> |
| 17 |
</p> |
| 18 |
|
| 19 |
<p> |
| 20 |
<strong><?php _e('Example', 'post-snippets'); ?></strong> |
| 21 |
<pre><code>url,name,role=user,title</code></pre> |
| 22 |
</p> |
| 23 |
|
| 24 |
|
| 25 |
<h3><?php _e('Snippet', 'post-snippets'); ?></h3> |
| 26 |
<p> |
| 27 |
<?php _e('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.', 'post-snippets'); ?> |
| 28 |
</p> |
| 29 |
|
| 30 |
<p><strong><?php _e('Example', 'post-snippets'); ?></strong></p> |
| 31 |
<p><?php _e('To reference the variables in the example above, you would enter {url} and {name}. So if you enter this snippet:', 'post-snippets'); ?></p> |
| 32 |
<p><?php _e('So if you enter this snippet:', 'post-snippets'); ?></p> |
| 33 |
|
| 34 |
<pre><code>This is the website of <a href="{url}">{name}</a></code></pre> |
| 35 |
|
| 36 |
<p><?php _e('You will get the option to replace url and name on insert if they are defined as variables.', 'post-snippets'); ?></p> |
| 37 |
|
| 38 |
|
| 39 |
<h3><?php _e('Description', 'post-snippets'); ?></h3> |
| 40 |
<p> |
| 41 |
<?php _e('An optional description for the Snippet. If filled out, the description will be displayed in the snippets insert window in the post editor.', 'post-snippets'); ?> |
| 42 |
</p> |
| 43 |
|
| 44 |
|
| 45 |
<h3><?php _e('Shortcode', 'post-snippets'); ?></h3> |
| 46 |
<p> |
| 47 |
<?php _e('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.', 'post-snippets'); ?> |
| 48 |
</p> |
| 49 |
|
| 50 |
<p> |
| 51 |
<?php _e('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.', 'post-snippets'); ?> |
| 52 |
</p> |
| 53 |
|
| 54 |
<p> |
| 55 |
<?php _e('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'); ?> |
| 56 |
</p> |
| 57 |
|
| 58 |
<h3><?php _e('PHP Code', 'post-snippets'); ?></h3> |
| 59 |
<p> |
| 60 |
<?php _e('See the dedicated help section for information about PHP shortcodes.', 'post-snippets'); ?> |
| 61 |
</p> |
| 62 |
|
| 63 |
<h3>wptexturize</h3> |
| 64 |
<p> |
| 65 |
<?php printf(__('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>'); ?> |
| 66 |
</p> |
| 67 |
|