{"id":71887,"date":"2017-07-21T12:48:31","date_gmt":"2017-07-21T12:48:31","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/snippy\/"},"modified":"2020-01-14T09:24:08","modified_gmt":"2020-01-14T09:24:08","slug":"snippy","status":"closed","type":"plugin","link":"https:\/\/ca.wordpress.org\/plugins\/snippy\/","author":15560945,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.4.1","stable_tag":"1.4.1","tested":"5.3.0","requires":"4.5","requires_php":"","requires_plugins":"","header_name":"Snippy","header_author":"PQINA","header_description":"Snippy, create your own super flexible shortcodes","assets_banners_color":"ffffff","last_updated":"2020-01-14 09:24:08","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/codecanyon.net\/user\/pqina\/portfolio?ref=pqina","header_plugin_uri":"https:\/\/pqina.nl\/snippy","header_author_uri":"https:\/\/pqina.nl","rating":5,"author_block_rating":0,"active_installs":600,"downloads":6083,"num_ratings":5,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":{"":"<p>Improved parsing of bits, HTML bits can now contain shortcodes. Three additional default placeholders were added.<\/p>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":5},"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":"1700304","resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":"1700304","resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":"1700333","resolution":"1544x500","location":"assets","locale":""},"banner-1880x609.png":{"filename":"banner-1880x609.png","revision":"1700333","resolution":"1880x609","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1700333","resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0","1.1.0","1.1.1","1.2.0","1.2.1","1.3.0","1.3.1","1.3.2","1.3.3","1.3.4","1.3.5","1.4.0","1.4.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1700351","resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1700351","resolution":"2","location":"assets","locale":""},"screenshot-3.png":{"filename":"screenshot-3.png","revision":"1700304","resolution":"3","location":"assets","locale":""}},"screenshots":{"1":"Creating an HTML bit containing a YouTube iframe snippet and setting the <code>{{id}}<\/code> placeholder.","2":"Creating a <code>[youtube]<\/code> shortcode that makes use of the YouTube iframe snippet.","3":"Adding the shortcode to the page and setting a YouTube video id."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[3776,5200,229,6438,80],"plugin_category":[43],"plugin_contributors":[144153],"plugin_business_model":[],"class_list":["post-71887","plugin","type-plugin","status-closed","hentry","plugin_tags-build","plugin_tags-create","plugin_tags-javascript","plugin_tags-short-code","plugin_tags-shortcode","plugin_category-customization","plugin_contributors-pqina","plugin_committers-pqina"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/snippy_ffffff.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/snippy\/assets\/screenshot-1.png?rev=1700351","caption":"Creating an HTML bit containing a YouTube iframe snippet and setting the <code>{{id}}<\/code> placeholder."},{"src":"https:\/\/ps.w.org\/snippy\/assets\/screenshot-2.png?rev=1700351","caption":"Creating a <code>[youtube]<\/code> shortcode that makes use of the YouTube iframe snippet."},{"src":"https:\/\/ps.w.org\/snippy\/assets\/screenshot-3.png?rev=1700304","caption":"Adding the shortcode to the page and setting a YouTube video id."}],"raw_content":"<!--section=description-->\n<p>Use Snippy to quickly create your own custom shortcodes.<\/p>\n\n<p>A Snippy shortcode is built by combining bits. A bit can be a file, like a <strong>Stylesheet<\/strong> or a <strong>Script<\/strong>, or a piece of code, like <strong>HTML<\/strong>, <strong>CSS<\/strong> or <strong>JavaScript<\/strong>.<\/p>\n\n<p>The \"code\" bits can contain placeholders, which are automatically made accessible as shortcode attributes.<\/p>\n\n<p><em>Time for a quick example.<\/em><\/p>\n\n<p>Let's create a shortcode to embed YouTube videos. We'll add an HTML bit and set the it's value to the YouTube embed iframe.<\/p>\n\n<pre><code>&lt;iframe src=\"https:\/\/youtube\/embed\/JZYYJY4yoK4\"\/&gt;\n<\/code><\/pre>\n\n<p>Now to make this bit a bit more flexible we will replace the YouTube video id with a placeholder value <code>{{id}}<\/code>.<\/p>\n\n<pre><code>&lt;iframe src=\"https:\/\/youtube\/embed\/{{id}}\"\/&gt;\n<\/code><\/pre>\n\n<p><em>Yay! We've finished our first bit!<\/em><\/p>\n\n<p>Now we can create a new Snippy shortcode and add the YouTube iFrame HTML bit. After saving the shortcode we can use our new and shiny YouTube shortcode in the text editor.<\/p>\n\n<pre><code>[[youtube id=JZYYJY4yoK4]]\n<\/code><\/pre>\n\n<p><em>Ready for more?<\/em><\/p>\n\n<p>The below 3 minute YouTube video shows how you can use Snippy to turn a jQuery plugin into a WordPress plugin.<\/p>\n\n[youtube https:\/\/www.youtube.com\/watch?v=JZYYJY4yoK4]\n\n<!--section=installation-->\n<ol>\n<li>Download the zip file.<\/li>\n<li>Log into WordPress, hover over <em>Plugins<\/em> and click <em>Add new<\/em><\/li>\n<li>Click on the <em>Upload Plugin<\/em> button.<\/li>\n<li>Select the zip file you downloaded.<\/li>\n<li>Click <em>Install Plugin<\/em>.<\/li>\n<li>Click <em>Activate<\/em>.<\/li>\n<li>Navigate to the 'Snippy' menu on the left and setup your first shortcode.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>Can I use JavaScript or CSS files instead of HTML<\/dt>\n<dd><p>Yes, you can select JS and CSS files to be added to a bit, Snippy will automatically load the files when the shortcode is used on a page.<\/p>\n\n<p>Please note that your server might prevent uploading files with a .js or .css extension. If that's the case you have to alter the server security settings to allow uploading of these files.<\/p><\/dd>\n<dt>How do I define placeholders<\/dt>\n<dd><p>You can define placeholders in bits by wrapping text in brackets like this: <code>{{placeholder}}<\/code>.<\/p>\n\n<p>Suppose you want to create a placeholder for a YouTube video. You'd replace the YouTube video id with <code>{{id}}<\/code>.<\/p>\n\n<pre><code>&lt;iframe src=\"https:\/\/youtube\/embed\/{{id}}\"\/&gt;\n<\/code><\/pre>\n\n<p>Now the attribute id is available in any shortcode that uses the YouTube HTML bit.<\/p>\n\n<pre><code>[[youtube id=JZYYJY4yoK4]]\n<\/code><\/pre><\/dd>\n<dt>How do I set a placeholder default value<\/dt>\n<dd><p>Placeholder default values can be set by following the placeholder name with a semicolon and then the default value.<\/p>\n\n<pre><code>{{name:John Doe}}\n<\/code><\/pre><\/dd>\n<dt>Which default placeholders can I use<\/dt>\n<dd><p>The following list of placeholders have a special function:<\/p>\n\n<ul>\n<li><code>{{content}}<\/code> is always replaced with the content wrapped by your shortcode.<\/li>\n<li><code>{{date_today}}<\/code> is replaced with an ISO8601 representation of today's date.<\/li>\n<li><code>{{date_tomorrow}}<\/code> is replaced with an ISO8601 representation of today's date.<\/li>\n<li><code>{{unique_id}}<\/code> is replaced with a uniquely generated id.<\/li>\n<li><code>{{shortcode_id}}<\/code> is replaced with the id of the current shortcode.<\/li>\n<li><code>{{bit_id}}<\/code> is replaced with the id of the current bit.<\/li>\n<li><code>{{page_id}}<\/code> is replaced with the current page id.<\/li>\n<li><code>{{page_relative_url}}<\/code> relative url to the current page.<\/li>\n<li><code>{{page_absolute_url}}<\/code> absolute url to the current page (includes the domain).<\/li>\n<li><code>{{theme}}<\/code> current theme name.<\/li>\n<li><code>{{theme_root_uri}}<\/code> theme directory URI.<\/li>\n<li><code>{{template_directory_uri}}<\/code> current theme directory URI.<\/li>\n<li><code>{{admin_url}}<\/code> current admin url.<\/li>\n<li><code>{{nonce_field:action,name}}<\/code> generate a nonce field.<\/li>\n<\/ul><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.4.1<\/h4>\n\n<ul>\n<li>Test with WordPress 5.3<\/li>\n<\/ul>\n\n<h4>1.4.0<\/h4>\n\n<ul>\n<li>Add <code>{{admin_url}}<\/code> and <code>{{nonce_field}}<\/code> placeholders.<\/li>\n<\/ul>\n\n<h4>1.3.5<\/h4>\n\n<ul>\n<li>Fixed problem where snippy shortcode menu was rendered before doctype<\/li>\n<\/ul>\n\n<h4>1.3.4<\/h4>\n\n<ul>\n<li>Fixed problem where paging would not work<\/li>\n<\/ul>\n\n<h4>1.3.3<\/h4>\n\n<ul>\n<li>Tested with WordPress 5.0.0<\/li>\n<\/ul>\n\n<h4>1.3.0<\/h4>\n\n<ul>\n<li>When using multiple placeholders with the same name, they will only show up once<\/li>\n<li>Add <code>bit_id<\/code> and <code>shortcode_id<\/code> placeholders<\/li>\n<\/ul>\n\n<h4>1.2.0<\/h4>\n\n<ul>\n<li>HTML bits can now contain shortcodes<\/li>\n<li>Add more placeholders<\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>Fix problem where shortcode and bits tables would not show paging control<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Add \"local\" or \"remote\" resource bit which makes possible the option to include CDN resources.<\/li>\n<li>Add a starter set of dynamic placeholders<\/li>\n<li>Only admin can now edit Snippy shortcodes<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Initial release<\/li>\n<\/ul>","raw_excerpt":"Makes it easy to create your own custom shortcodes.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/71887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=71887"}],"author":[{"embeddable":true,"href":"https:\/\/ca.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/pqina"}],"wp:attachment":[{"href":"https:\/\/ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=71887"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=71887"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=71887"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=71887"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=71887"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/ca.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=71887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}