您所指的具体功能是wpautop, 添加段落和;HTML换行符到已混合的HTML(&A);纯文本。
wpautop 是连接到的一系列内容处理函数的一部分the_content, 在输出之前从数据库中提取帖子内容后,应用于帖子内容的过滤器。查看wp-includes/default-filters.php, 您可以看到默认功能有:
add_filter( \'the_content\', \'wptexturize\' );
add_filter( \'the_content\', \'convert_smilies\' );
add_filter( \'the_content\', \'wpautop\' );
add_filter( \'the_content\', \'shortcode_unautop\' );
add_filter( \'the_content\', \'prepend_attachment\' );
add_filter( \'the_content\', \'wp_make_content_images_responsive\' );
您可以使用删除它们
remove_filter( \'the_content\', \'name_of_function\' ), 并添加您自己的
add_filter( \'the_content\', \'my_function\' ); - 看见
the documentation 有关添加筛选器的详细信息。