WordPress plugin to make it easier to create block patterns.

Overview
=== Templets ===
Contributors: mkaz
Tags: block patterns, patterns
Requires at least: 5.8
Tested up to: 5.8
Requires PHP: 7.3
Stable tag: 0.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Templets provides a custom post type to create and register block patterns.

== Description ==

Templets adds a new custom post type that allows for creating block patterns. Any new templet post will be registered as a block pattern usable in the block editor.

Using Templets provides an easy way for authors and content creators to create patterns.

Primary development and issues tracked on Github at: [https://github.com/mkaz/templets](https://github.com/mkaz/templets)

== Installation ==

Install and activate the plugin. Navigate to Templets from side menu to add new pattern. Patterns show in editor insertePatterns show in editor inserter under templets category.


== Screenshots ==

1. Templets list view
2. Templets in pattern inserter

== Changelog ==

= 0.2.0 =

- Initial release.

You might also like...
WordPress plugin that lets you use Discourse as the community engine for a WordPress blog

WP Discourse Note: the wp-discourse plugin requires = PHP-5.4.0. The WP Discourse plugin acts as an interface between your WordPress site and your Di

Simple WordPress plugin to learn how to understand WordPress Crons and the Action Scheduler library.

Simple WordPress plugin to learn how to understand WordPress Crons and the Action Scheduler library. Import Jamendo playlists with tracks in WordPress posts.

This WordPress Plugin Boilerplate is meant for you to develop your own plugin on.

WordPress Plugin Boilerplate This plugin boilerplate is meant for you to develop your own plugin on. Support & collaboration Features OOP plugin core

A better way to create WordPress themes.

Runway Framework for WordPress Visit the Runway website: RunwayWP.com A better way to create WordPress themes. Runway was built for creating WordPress

Create WordPress themes with beautiful OOP code and the Twig Template Engine
Create WordPress themes with beautiful OOP code and the Twig Template Engine

By Jared Novack (@jarednova), Lukas Gächter (@lgaechter), Pascal Knecht (@pascalknecht), Maciej Palmowski (@palmiak_fp), Coby Tamayo (@cobytamayo), Up

This is code to create a new user as admin use for Wordpress FrontEnd Developer to prevent any scaming from clients

theme-setup This is code to create a new user as admin use for Wordpress FrontEnd Developer to prevent any scaming from clients How to use Just copy c

Create custom WordPress routes and redirects, restrict access by roles and/or capabilities. Routes made simple
Create custom WordPress routes and redirects, restrict access by roles and/or capabilities. Routes made simple

Create custom WordPress routes and redirects, restrict access by roles and/or capabilities. Routes made simple

A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.

WP Bootstrap Navwalker This code in the main repo branch is undergoing a big shakeup to bring it in line with recent standards and to merge and test t

A curated list of Awesome WordPress Theme, Plugins and Framework development Resources and WordPress Communities.

Awesome WordPress A curated list of Awesome WordPress Theme, Plugins and Framework development Resources and WordPress Communities. Inspired by bayand

Comments
  • Doesn't work out of the box when allowed_block_types_all is used

    Doesn't work out of the box when allowed_block_types_all is used

    As the title states, this plugin does not work when using allowed_block_types_all filter.

    add_filter('allowed_block_types_all', function($allowed) use ($app) {
      // I've ignored $allowed deliberately in this case, since it always contains `true` in my case.
    
      $core = [
        'core/block', // required for reusable blocks
        'core/template', // see above
    
        // Core has like 200 different blocks and 190 of them are trash.
        'core/paragraph',
        'core/image',
        'core/heading',
        'core/list',
        'core/nextpage',
        'core/separator',
        'core/shortcode',
        'core/embed',
        'core/columns',
      ];
    
      $acfBlocks = [];
    
      foreach ($app->getBlocks() as $block) {
        $acfBlocks[] = 'acf/' . strtolower($block->getName());
      }
    
      return array_merge($core, $acfBlocks);
    }, PHP_INT_MAX); // This ensures that the only blocks available are blocks that work in our custom theme
    

    There are no patterns available. (I've also disabled all core patterns because they look like trash)

    image

    Disabling the filter (and thus making the editor way harder to use w/ the useless block bloat) makes the plugin work.

    image

    I don't have many ideas on how to solve this problem properly from the plugin directly. The one that I do have?

    Gather the templet handles, and call allowed_block_types_all filter:

    add_filter('allowed_block_types_all', function($allowed) {
      // loop and build the array 
      return array_merge($allowed, [
       "templet/test222"
      ]);
    }, 100000); // Late priority so plugins and themes have already set the value 
    

    Then, I might be able to check if $allowed contains something else than true (the dumb default WP chose) and merge it with my own whitelist.

    I say might, because I added "templet/test222" to my whitelist and that doesn't work.

    Then there's also the fun case of "using allowed_block_types_all filter requires you to whitelist each and every block manually", which means that if the site isn't already using the filter, using it in this plugin would make every block unavailable. You just might be able to work around that issue by checking the contents of $allowed, and if it's not an array, return the value as is.

    opened by k1sul1 2
Releases(v0.2.0)
Owner
Marcus Kazmierczak
Marcus Kazmierczak
WordPress entities creation library (CPT, CT, native option page, ACF option page, user role, block pattern category, block category…)

WordPress entities creation library (CPT, CT, native option page, ACF option page, user role, block pattern category, block category…)

Loïc Antignac 2 Jul 25, 2022
WordPress plugin boilerplate using React and Block Editor components.

PluginWP Foundation ?? UNDER DEVELOPMENT ?? This code serves as a starting point for building a WordPress plugin using React and the block editor comp

JR Tashjian 5 Dec 8, 2022
WordPress single-page theme with profile patterns.

X3P0 - Reflections A one-page user-profile WordPress theme. Really, it's just a single page. View Demo → Recommended This theme is designed to work wi

X3P0 25 Nov 4, 2022
📦 A zero-configuration #0CJS developer toolkit for building WordPress Gutenberg block plugins.

create-guten-block is zero configuration dev-toolkit (#0CJS) to develop WordPress Gutenberg blocks in a matter of minutes without configuring React, w

Ahmad Awais ⚡️ 3.1k Dec 23, 2022
A simple little WordPress block that allows you add social share icons to your website.

Social Sharing Block This plugin requires WordPress 5.9+ or 5.8+ with Gutenberg active. A simple little block that allows you to add social share icon

Nick Diego 18 Dec 27, 2022
A plugin to disable the drop cap option in Gutenberg editor paragraph block. This is version 2.

Disable Drop Cap (v2) A plugin to disable drop cap option in the Gutenberg editor block editor paragraph block. Note for WordPress 5.8 With WordPress

Johannes Siipola 4 Jan 4, 2022
A WordPress plugin to create Blockbase child themes

Create Blockbase Theme A WordPress plugin to create Blockbase child themes Find out more about Blockbase at blockbasetheme.com Step 1 – Setup Install

Automattic 171 Jan 3, 2023
A super simple abstraction to make creating a custom Taxonomies in WordPress a breeze

A super simple abstraction to make creating a custom Taxonomies in WordPress a breeze

Joe Grant 2 Apr 5, 2022
The Pronamic WordPress Basecone plugin allows you to connect your WordPress installation to Basecone.

Pronamic WordPress Basecone The Pronamic WordPress Basecone plugin allows you to connect your WordPress installation to Basecone. Table of contents Au

Pronamic 1 Oct 19, 2021
A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings.

Suspend WP A WordPress plugin to suspend WordPress sites automagically. Simple and lightweight, no annoying ads and fancy settings. ?? Demo (coming so

Waren Gonzaga 3 Nov 15, 2021