php WordPress中的自定义TinyMCE格式

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php WordPress中的自定义TinyMCE格式相关的知识,希望对你有一定的参考价值。

/**
 * The lead paragraph text
 *
 * If you choose the 'Lead Paragraph' formatting from the TinyMCE editor a <p>
 * with the class of .lead is applied to it.
 */
.lead {
	font-size: 120%;
}
<?php

/**
 * TinyMCE Formatting
 *
 * Adds a pagraph around selected text with a class of .lead.
 *
 * @param  array $settings Array of TinyMCE settings
 * @return array           Array of TinyMCE settings
 */
function mwtsn_tinymce_formatting( $settings ) {
	$style_formats = array(
		array(
			'title'   => 'Lead Paragraph',
			'block'   => 'p',
			'classes' => 'lead',
			'wrapper' => false,
		),
	);
	$settings['style_formats'] = json_encode( $style_formats );
	return $settings;
}
add_filter( 'tiny_mce_before_init', 'mkdo_tinymce_formatting' );

以上是关于php WordPress中的自定义TinyMCE格式的主要内容,如果未能解决你的问题,请参考以下文章

php WordPress:创建TinyMCE自定义按钮

php WordPress:创建TinyMCE自定义按钮

php WordPress:创建TinyMCE自定义按钮

php WordPress:创建TinyMCE自定义按钮

php WordPress:创建TinyMCE自定义按钮

PHP Wordpress:自定义TinyMCE按钮