{"id":29245,"date":"2014-05-04T13:23:45","date_gmt":"2014-05-04T13:23:45","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/codeblocks\/"},"modified":"2015-01-24T15:58:39","modified_gmt":"2015-01-24T15:58:39","slug":"codeblocks","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/codeblocks\/","author":12955509,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.1.0","stable_tag":"trunk","tested":"4.1.42","requires":"3.6","requires_php":"","requires_plugins":"","header_name":"Codeblocks","header_author":"z43 Studio","header_description":"","assets_banners_color":"","last_updated":"2015-01-24 15:58:39","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/z43studio.com\/","header_plugin_uri":"http:\/\/www.z43studio.com","header_author_uri":"http:\/\/www.z43studio.com","rating":5,"author_block_rating":0,"active_installs":20,"downloads":1730,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"3"},"assets_icons":[],"assets_banners":[],"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1074896","resolution":"1","location":"assets"}},"screenshots":{"1":"Codeblocks adds source code editors below your main post body."}},"plugin_section":[],"plugin_tags":[4121,1214,734,86,2207],"plugin_category":[46],"plugin_contributors":[89911],"plugin_business_model":[],"class_list":["post-29245","plugin","type-plugin","status-closed","hentry","plugin_tags-blocks","plugin_tags-code","plugin_tags-development","plugin_tags-post","plugin_tags-syntax","plugin_category-editor-and-writing","plugin_contributors-z43-studio","plugin_committers-z43-studio"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/codeblocks.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/codeblocks\/assets\/screenshot-1.png?rev=1074896","caption":"Codeblocks adds source code editors below your main post body."}],"raw_content":"<!--section=description-->\n<p>Codeblocks lets you add highlighted and formatted source code into your website without cluttering the visual editor. Write your code in individual blocks outside the built-in Content editor, and access these blocks simply by adding <code>[codeblock name='MY_BLOCK']<\/code> into your blog post or page. Codeblocks highlights the code on your website using <a href=\"http:\/\/craig.is\/making\/rainbows\">Rainbow.js<\/a>, and themes can customize the color scheme of your code.<\/p>\n\n<p><a href=\"http:\/\/z43studio.com\/2014\/05\/codeblocks\/\">http:\/\/z43studio.com\/2014\/05\/codeblocks\/<\/a><\/p>\n\n<p><strong>Theme editors:<\/strong> See the Installation section for information on how to adjust Codeblocks options in your theme.<\/p>\n\n<h3>Theme Editors<\/h3>\n\n<p>You can hook into <code>codeblocks\/rainbow_theme<\/code> filter inside your <code>functions.php<\/code> file to change the Rainbow.js theme (there are many <a href=\"https:\/\/github.com\/ccampbell\/rainbow\/tree\/master\/themes\">themes on GitHub<\/a>). Return a URL to the new theme stylesheet file, or <code>null<\/code> to disable highlighting, or <code>true<\/code> to only include the Rainbow.js file without a theme (useful if your themes already-loaded stylesheet file contains the code highlighting styles). Here's a few examples:<\/p>\n\n<pre><code>add_filter('codeblocks\/rainbow_theme', function($oldURL) {\n\n    \/\/ Use the file 'cool-rainbow.css' inside our theme directory\n\n    return plugins_url('cool-rainbow.css', __FILE__);\n});\n<\/code><\/pre>\n\n<p>You can also disable code highlighting with your theme by returning <code>null<\/code> in the filter.<\/p>\n\n<pre><code>add_filter('codeblocks\/rainbow_theme', function($oldURL) {\n\n    \/\/ Disable code highlighting on our theme\n\n    return null;\n});\n<\/code><\/pre>\n\n<p>If your theme's base stylesheet file already includes the Rainbow.js styles, just return <code>true<\/code> and we'll skip importing the stylesheets, and just load the Rainbow.js plugin.<\/p>\n\n<pre><code>add_filter('codeblocks\/rainbow_theme', function($oldURL) {\n\n    \/\/ Add Rainbow.js tags, but don't include a separate stylesheet file\n\n    return true;\n});\n<\/code><\/pre>\n\n<!--section=installation-->\n<p>The plugin is simple to install:<\/p>\n\n<ol>\n<li>Download the Codeblocks plugin file (<code>.zip<\/code>)<\/li>\n<li>Unzip and upload the plugin files folder to your <code>wp-content\/plugins<\/code> folder<\/li>\n<li>Go to the Plugins page and activate the Codeblocks plugin<\/li>\n<\/ol>\n\n<p>While writing a post or page in your blog, add your code in the <strong>Codeblocks<\/strong> section of the Edit page. If this section does not show up, open the <strong>Screen Options<\/strong> dropdown from the top of the page and make sure Codeblocks is checked.<\/p>\n\n<p>In your article content, you can access your blocks of code using <code>[codeblock name='MY_BLOCK']<\/code> where <code>MY_BLOCK<\/code> is whatever you titled your block of code. Codeblocks will automatically take care of setting up the highlighting feature on your website.<\/p>\n\n<!--section=changelog-->\n<h4>1.1.0.1 (current)<\/h4>\n\n<ul>\n<li>Updated to WordPress 4.1 Support<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Merged ACF Plugin dependency with Codeblocks<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Fixed an issue with CodeMirror dependencies<\/li>\n<li>Fixed an issue with PHP Language highlighting <\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Released. And awesome.<\/li>\n<\/ul>","raw_excerpt":"Add formatted source code blocks into your blog posts.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/29245","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=29245"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/z43-studio"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=29245"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=29245"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=29245"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=29245"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=29245"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=29245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}