Created
April 30, 2020 21:08
-
-
Save lunaluna/580f577259cfbe9e7ee1c32438c3aa90 to your computer and use it in GitHub Desktop.
カスタムブロックスタイルのサンプルプラグイン - 三鷹・吉祥寺 WordPress Meetup「オンラインゆるもく会 + LT」(2020/5/2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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