Skip to content

Instantly share code, notes, and snippets.

@lunaluna
Created April 30, 2020 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lunaluna/580f577259cfbe9e7ee1c32438c3aa90 to your computer and use it in GitHub Desktop.
Save lunaluna/580f577259cfbe9e7ee1c32438c3aa90 to your computer and use it in GitHub Desktop.
カスタムブロックスタイルのサンプルプラグイン - 三鷹・吉祥寺 WordPress Meetup「オンラインゆるもく会 + LT」(2020/5/2)
<?php
/**
* Plugin Name: L2D Sample Custom Block Styles
* Plugin URI: https://gist.github.com/lunaluna/580f577259cfbe9e7ee1c32438c3aa90
* Description: Sample custom block style plugin for Mitaka - Kichijyoji WordPress Meetup 2020/05/02
* Author: Hiroki Saiki
* Author URI: https://lunalunadesign.net/
* Version: 1.0.0
* License: GPL2+
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt
*
*/
function l2d_sample_custom_block_styles_assets() {
register_block_style(
'core/heading',
array(
'name' => 'heading-reverse',
'label' => '反転色',
'inline_style' => '.is-style-heading-reverse {
color: #f5efe0 !important;
padding: .5rem;
background-color: #000;
}',
)
);
}
add_action( 'init', 'l2d_sample_custom_block_styles_assets' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment