generoi / wp-gutenberg-button-popup

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wp-gutenberg-button-popup

A Gutenberg block for creating buttons that open popups

gutenberg-popups

Installation

composer require generoi/wp-gutenberg-button-popup

Requirements

  • WordPress 5.6 or newer

Usage

You can customize the default template for popups with a filter.

import { addFilter } from '@wordpress/hooks'

addFilter('wp-gutenberg-button-popup.popupTemplate', 'theme/popup-template', () => {
  return [
    ['core/columns', {align: 'full'}, [
      ['core/column', {}, [
        ['core/image'],
        ['core/group']
      ]],
      ['core/column', {}, [
        ['core/heading'],
        ['core/paragraph'],
        ['core/list'],
        ['core/buttons'],
      ]],
    ]],
  ];
})

Development

Install dependencies

composer install
npm install

Run the tests

npm run test

Build assets

# Minified assets which are to be committed to git
npm run build:production

# Watch for changes and re-compile while developing the plugin
npm run start

About


Languages

Language:JavaScript 55.1%Language:PHP 28.9%Language:SCSS 15.9%