Skip to content

Instantly share code, notes, and snippets.

View andreilupu's full-sized avatar
⌨️
Hitting keys

Andrei Lupu andreilupu

⌨️
Hitting keys
View GitHub Profile
@andreilupu
andreilupu / 1-index.js
Last active February 3, 2024 14:38
WordPress Post Title variation which prints a <li> instead of <h{n}>
// register a new post title variation.
// In a production environment I would register a new attribute called "isLiPostTitle" and use that instead of checking the className.
window.wp.blocks.registerBlockVariation(
'core/post-title',
{
name: 'core/post-title-li',
title: 'Post title (li)',
attributes: {
className: 'is-li-title'
},