<?php if ( !defined( 'ABSPATH' ) ) exit;//PHPの宣言と直接アクセスの拒否

/* 20200831 admin_enqueue_scriptをエディター以外へ限定したため */
/* wp-edit-blocksでエディターへ反映させるよう変更 */
function haup_add_editor_spacer_block_bg(){

$text = sanitize_text_field(__("'Spacer block is inserted'","hima-art-utility"));

$custom_css_pre = hau_sanitize_css("
	.wp-block-spacer {
	background: #fafafa;
	border: 1px solid #777!important;
}

.wp-block-spacer:before {
	content: $text!important;
	color:#777;
	text-align:center;
	padding-top:4px;
}
");

//タブを除去
$custom_css_deltab = preg_replace('/\t+/', '', $custom_css_pre);
//改行を除去
$custom_css = str_replace(PHP_EOL, '', $custom_css_deltab);
//インラインでCSS出力
	wp_add_inline_style( 'wp-edit-blocks', $custom_css );

}
add_action('init','haup_add_editor_spacer_block_bg');