doggs
フォーラムへの返信
4件の返信を表示中 - 1 - 4件目 (全4件中)
-
フォーラム: 使い方全般
返信が含まれるトピック: ビジュアルエディタ(tinyMCE)のドロップダウンメニューについてフォーラム: 使い方全般
返信が含まれるトピック: ビジュアルエディタ(tinyMCE)のドロップダウンメニューについてishitakaさん
上記にて改善いたしました。
ありがとうございます。
大変助かりました。wrapper – State that tells that the current format is a container format for block elements. For example a div wrapper or blockquote.
ブロック要素のcontainerだったらtrue
h2にはブロック要素がいれられないので、falseにする必要があったということでしょうか。フォーラム: 使い方全般
返信が含まれるトピック: ビジュアルエディタ(tinyMCE)のドロップダウンメニューについてishitakaさん、ご返信ありがとうございます。
具体的なコードは下記となります。
// Callback function to filter the MCE settings function my_mce_before_init_insert_formats( $init_array ) { // Define the style_formats array $style_formats = array( // Each array child is a format with it's own settings array( 'title' => '.translation', 'block' => 'h2', 'classes' => 'translation', 'wrapper' => true, ), array( 'title' => '⇠.rtl', 'block' => 'blockquote', 'classes' => 'rtl', 'wrapper' => true, ), array( 'title' => '.ltr⇢', 'block' => 'blockquote', 'classes' => 'ltr', 'wrapper' => true, ), ); // Insert the array, JSON ENCODED, into 'style_formats' $init_array['style_formats'] = json_encode( $style_formats ); return $init_array; } // Attach callback to 'tiny_mce_before_init' add_filter( 'tiny_mce_before_init', 'my_mce_before_init_insert_formats' );
下記ページのコード最初のblockの部分をh2に変更いたしました。
https://codex.wordpress.org/TinyMCE_Custom_Stylesドロップダウンメニューには表示されるのですが、
h2の部分を選択をしても、文章に適用がされないような状況です。フォーラム: 使い方全般
返信が含まれるトピック: ビジュアルエディタ(tinyMCE)のドロップダウンメニューについて
4件の返信を表示中 - 1 - 4件目 (全4件中)