구텐베르크 | 블록 생성하기

|

<?php
/*
Plugin Name: 라잇 플러그인
Description: 첫 플러그인입니다
Version : 1.0
Author : 정라잇
Author URI : https://www.light-coding.com
*/

if (!defined('ABSPATH')) exit;

class AreyouPayingAttention
{
    function __construct()
    {
        add_action('enqueue_block_editor_assets', array($this, 'adminAssets'));
    }

    function adminAssets()
    {
        wp_enqueue_script('ournewblocktype', plugin_dir_url(__FILE__) . 'test.js', array('wp-blocks', 'wp-element'));
    }
}


$areYouPayingAttention = new AreyouPayingAttention();

wp.blocks.registerBlockType("rdgblock/toc", {
  title: "블록명",
  icon: "smiley",
  category: "common",
  edit: function() {
      return wp.element.createElement("h3", null, "hello")
  },
  save: function() {
      return wp.element.createElement("h3", null, "hello")
  }
})

참조

블록 생성방법

Building Custom Gutenberg Blocks: The Definitive Block Development Tutorial (kinsta.com)

구텐베르크 사이드바 개발 방법

Building a Gutenberg sidebar plugin Part 1: Registering the plugin with (oop) php – Since1979

the_content() 사용 안하고 내용 불러오기

php – Get Gutenberg Blocks without the_content() – Stack Overflow

구텐베르크 블록 비활성화

How to Disable Gutenberg Blocks (rudrastyh.com)

구텐베르크 자동 완성

구텐베르크/패키지/컴포넌트/src/트렁크에서 자동 완성 · 워드 프레스 / 구텐베르크 (github.com)

Autocomplete | Block Editor Handbook | WordPress Developer Resources

구텐베르크 CSS 비활성화

gutenberg remove default styles Code Example (codegrepper.com)

단축키 정리

65+ WordPress Keyboard Shortcuts for Writing, Gutenberg + More (kinsta.com)

Hugely Useful WordPress Keyboard Shortcuts For Gutenberg (wp-content.co)

플러그인

@user 자동완성 해제

Remove @User Autocomplete from Block Editor – WordPress plugin | WordPress.org

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다

클릭하여 복사