Snow Monkey v10.8.0 の概要
機能追加
template-parts/archive/entry/content/contentにテンプレート変数を追加- フィルターフック
snow_monkey_comment_form_argsを追加 - 個別ページの
.c-entry__contentの先頭にアクションフックsnow_monkey_prepend_entry_contentを追加 - 個別ページの
.c-entry__contentの最後にアクションフックsnow_monkey_append_entry_contentを追加 - アーカイブページの
.c-entry__contentの前にアクションフックsnow_monkey_before_archive_entry_contentを追加 - アーカイブページの
.c-entry__contentの後にアクションフックsnow_monkey_after_archive_entry_contentを追加 - アーカイブページの
.c-entry__contentの先頭にアクションフックsnow_monkey_prepend_archive_entry_contentを追加 - アーカイブページの
.c-entry__contentの先頭にアクションフックsnow_monkey_append_archive_entry_contentを追加
変更
- 「Snow Monkey: 最近の投稿」ウィジェットのサムネイルサイズの初期値を「中サイズ」→「medium_large」に変更
- 「Snow Monkey: 任意のタクソノミー投稿」ウィジェットのサムネイルサイズの初期値を「中サイズ」→「medium_large」に変更
- コメントフォーム部分を別テンプレートに切りだし
- JavaScript をリファクタリング
不具合の修正
.c-select--blockのデザイン崩れを修正- オブジェクトキャッシュを永続化している状態でアップデートをするとページヘッダーの表示時に
Fatal Errorになることがある不具合を修正
template-parts/archive/entry/content/content にテンプレート変数を追加
下記のテンプレート変数を追加しました。
_entries_layout… 一覧のレイアウトを変更_force_sm_1col… スマホで1カラムを強制する
例えば、下記のコードでカスタム投稿タイプ news のカスタム投稿アーカイブを simple レイアウトで表示できます。
add_filter(
'snow_monkey_get_template_part_args',
function( $args ) {
if ( 'template-parts/archive/entry/content/content' === $args['slug'] && 'news' === $args['name'] ) {
$args['vars']['_entries_layout'] = 'simple';
}
return $args;
}
);
コメントフォーム部分を別テンプレートに切りだし&snow_monkey_comment_form_args フィルターフック
resources/template-parts/discussion/comments.php の comment_form() 部分を resources/template-parts/discussion/comment-form.php に切りだしました。
また、このコメントフォーム呼びだし時に渡す引数を snow_monkey_comment_form_args フィルターフックでカスタマイズできるようになりました。初期値は空です。使用可能な引数は下記を確認してください。
