এই প্লাগইনটি ওয়ার্ডপ্রেসের সর্বশেষ ৩টি মেজর রিলিজের সাথে পরীক্ষা করা হয়নি। এটি আর রক্ষণাবেক্ষণ বা সমর্থন করা নাও হতে পারে এবং ওয়ার্ডপ্রেসের আরও সাম্প্রতিক সংস্করণগুলোর সাথে ব্যবহার করার সময় কম্প্যাটিবিলিটি ইস্যু থাকতে পারে।

Jinx-Block-Renderer

Description

The plugin allows you to parse all kinds gutenberg blocks and render them in your own template.

Usage

Use the filter ‘jinx_block_renderers’ in your theme to render gutenberg blocks.

<?php

  function my_render_function(array $fields)
  {
    echo $fields['url'];
  }

  add_filter('jinx_block_renderers', function($renderers) {

    $renderers[] = [
      'block' => 'core-embed/youtube', // name of the block
      'conditions' => [], // default - accepts an array of key value pairs
      // 'conditions' => [
      //   'className' => 'is-style-custom', // strings are used inside a regular expression
      //   'field' => function($value) { // callbacks will receive the fields value and must return true or false
      //     return $value === 'some value';
      //   }
      // ],
      'fields' => [
        'url' => [ // name of your parameter
          'path' => '//iframe[@src]',
          'item' => 0,
          // 'item' => 9, // if not exists, will return null
          // 'item': 'first', // constant Jinx\BlockRenderer\Field::ITEM_FIRST
          // 'item': 'last', // constant Jinx\BlockRenderer\Field::ITEM_LAST
          // 'item': null // default - returns all results as an array
          'attr' => 'src',
          //'attr' => null // default - returns the results value
          //'filter' => 'my_filter_function' // filters each matched field
        ],
      ],
      // 'insert' => '//*[contains(@class,"wp-block-")]' // default - inserts rendered block back into the block-wrapper
      'template' => __DIR__.'/youtube-video.php', // relative path, templates will handle each field as a variable
      // 'callback' => 'my_render_function'
    ];

    return $renderers;

  });

?>

Installation

  1. Unzip the downloaded package
  2. Upload jinx-block-renderer to the /wp-content/plugins/ directory
  3. Activate the plugin through the ‘Plugins’ menu in WordPress

Reviews

There are no reviews for this plugin.

ডেভেলপার এবং কন্ট্রিবিউটর

“Jinx-Block-Renderer” is open source software. The following people have contributed to this plugin.

কন্ট্রিবিউটর

Translate “Jinx-Block-Renderer” into your language.

ডেভেলপমেন্ট এ আগ্রহী?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.