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
wp.domReady( () => { | |
const unregisterBlocks = [ | |
'core/freeform', | |
'core/pullquote', | |
'core/verse', | |
]; | |
unregisterBlocks.forEach( blockName => { | |
wp.blocks.unregisterBlockType( blockName ); | |
} ); |
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
wp.domReady( () => { | |
const registerBlocks = [ | |
'core/paragraph', | |
'core/heading', | |
'core/list', | |
'core/embed', | |
]; | |
wp.blocks.getBlockTypes().forEach( block => { | |
if ( ! registerBlocks.includes( block.name ) ) { | |
wp.blocks.unregisterBlockType( block.name ); |
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 | |
/** | |
* 不要なブロックを非表示にする (ブラックリスト形式) | |
* $unregister_blocks に非表示にするブロックを指定する。 | |
*/ | |
add_filter( | |
'allowed_block_types_all', | |
function( $allowed_block_types, $block_editor_context ) { | |
$default_blocks = []; | |
$blocks = WP_Block_Type_Registry::get_instance()->get_all_registered(); |
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 | |
/** | |
* 必要なブロックのみ表示 | |
*/ | |
add_filter( 'allowed_block_types', 'custom_allowed_block_types' ); | |
function custom_allowed_block_types( $allowed_block_types ) { | |
if ( !current_user_can('administrator') ) { //管理者ではない場合 | |
$allowed_block_types = array( | |
// テキスト |
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 | |
/** | |
* disable .c-entry-summary__term | |
* 各投稿一覧で デフォルトの taxonomy ラベルを削除 | |
* | |
* @param string $html はコンテンツの中身. | |
*/ | |
add_filter( | |
'snow_monkey_template_part_render_template-parts/loop/entry-summary/term/term', | |
function ( $html ) { |
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 | |
/** | |
* 投稿一覧の .c-entry-summary__titleを h2 に変更 | |
* | |
* @param string $args 文字列. | |
*/ | |
add_filter( | |
'snow_monkey_get_template_part_args_template-parts/loop/entry-summary/title/title', | |
function ( $args ) { | |
$args['vars']['_title_tag'] = 'h2'; |
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
<a href="#anchor" class="u-smooth-scroll">リンク</a> |
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 | |
// [reusable slug=$slug] | |
add_shortcode( | |
'reusable', | |
function ( $atts ) { | |
extract( shortcode_atts( | |
array( | |
'slug' => '', | |
), $atts ) ); | |
ob_start(); |
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 | |
add_filter( | |
// PC 用ヘッダー位置をカスタマイズ | |
'theme_mod_header-position-lg', | |
function( $value ) { | |
// フロントページならば | |
if ( is_front_page() ) { | |
// オーバーレイ(上部固定 / スクロール時背景白) | |
return 'sticky-overlay-colored'; | |
} |
NewerOlder