{"id":126896,"date":"2020-08-12T07:40:29","date_gmt":"2020-08-12T07:40:29","guid":{"rendered":"https:\/\/de.wordpress.org\/plugins\/jinx-block-renderer\/"},"modified":"2020-12-03T14:30:58","modified_gmt":"2020-12-03T14:30:58","slug":"jinx-block-renderer","status":"publish","type":"plugin","link":"https:\/\/lmo.wordpress.org\/plugins\/jinx-block-renderer\/","author":8023631,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"0.2.0","stable_tag":"trunk","tested":"5.5.18","requires":"5.0","requires_php":"7.1","requires_plugins":"","header_name":"Jinx Block Renderer","header_author":"SquareFlower Websolutions (Lukas Rydygel) <hallo@squareflower.de>","header_description":"Manipulate Gutenberg Blocks","assets_banners_color":"b1bee4","last_updated":"2020-12-03 14:30:58","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/jinx-block-renderer\/","header_author_uri":"https:\/\/squareflower.de","rating":0,"author_block_rating":0,"active_installs":10,"downloads":972,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation"],"tags":[],"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":2358346,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.png":{"filename":"icon-256x256.png","revision":2358346,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":2358346,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":[],"block_files":[],"assets_screenshots":[],"screenshots":[],"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[4121,148076,5594,975],"plugin_category":[43],"plugin_contributors":[158154],"plugin_business_model":[],"class_list":["post-126896","plugin","type-plugin","status-publish","hentry","plugin_tags-blocks","plugin_tags-gutenberg","plugin_tags-manipulate","plugin_tags-template","plugin_category-customization","plugin_contributors-lugat","plugin_committers-lugat"],"banners":{"banner":"https:\/\/ps.w.org\/jinx-block-renderer\/assets\/banner-772x250.jpg?rev=2358346","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/jinx-block-renderer\/assets\/icon-128x128.png?rev=2358346","icon_2x":"https:\/\/ps.w.org\/jinx-block-renderer\/assets\/icon-256x256.png?rev=2358346","generated":false},"screenshots":[],"raw_content":"<!--section=description-->\n<p>The plugin allows you to parse all kinds gutenberg blocks and render them in your own template.<\/p>\n\n<h3>Usage<\/h3>\n\n<p>Use the filter 'jinx_block_renderers' in your theme to render gutenberg blocks.<\/p>\n\n<pre><code>&lt;?php\n\n  function my_render_function(array $fields)\n  {\n    echo $fields['url'];\n  }\n\n  add_filter('jinx_block_renderers', function($renderers) {\n\n    $renderers[] = [\n      'block' =&gt; 'core-embed\/youtube', \/\/ name of the block\n      'conditions' =&gt; [], \/\/ default - accepts an array of key value pairs\n      \/\/ 'conditions' =&gt; [\n      \/\/   'className' =&gt; 'is-style-custom', \/\/ strings are used inside a regular expression\n      \/\/   'field' =&gt; function($value) { \/\/ callbacks will receive the fields value and must return true or false\n      \/\/     return $value === 'some value';\n      \/\/   }\n      \/\/ ],\n      'fields' =&gt; [\n        'url' =&gt; [ \/\/ name of your parameter\n          'path' =&gt; '\/\/iframe[@src]',\n          'item' =&gt; 0,\n          \/\/ 'item' =&gt; 9, \/\/ if not exists, will return null\n          \/\/ 'item': 'first', \/\/ constant Jinx\\BlockRenderer\\Field::ITEM_FIRST\n          \/\/ 'item': 'last', \/\/ constant Jinx\\BlockRenderer\\Field::ITEM_LAST\n          \/\/ 'item': null \/\/ default - returns all results as an array\n          'attr' =&gt; 'src',\n          \/\/'attr' =&gt; null \/\/ default - returns the results value\n          \/\/'filter' =&gt; 'my_filter_function' \/\/ filters each matched field\n        ],\n      ],\n      \/\/ 'insert' =&gt; '\/\/*[contains(@class,\"wp-block-\")]' \/\/ default - inserts rendered block back into the block-wrapper\n      'template' =&gt; __DIR__.'\/youtube-video.php', \/\/ relative path, templates will handle each field as a variable\n      \/\/ 'callback' =&gt; 'my_render_function'\n    ];\n\n    return $renderers;\n\n  });\n\n?&gt;\n<\/code><\/pre>\n\n<!--section=installation-->\n<ol>\n<li>Unzip the downloaded package<\/li>\n<li>Upload <code>jinx-block-renderer<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<\/ol>","raw_excerpt":"Render WP Gutenberg Block the way you want.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/126896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=126896"}],"author":[{"embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/lugat"}],"wp:attachment":[{"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=126896"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=126896"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=126896"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=126896"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=126896"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/lmo.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=126896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}