_restore_wpautop_hook

函数
_restore_wpautop_hook ( $content )
Access
Private
参数
  • (string) $content The post content running through this filter.
    Required:
返回值
  • (string) The unmodified content.
定义位置
相关方法
_future_post_hookregister_activation_hook_save_post_hookregister_deactivation_hookrestore_current_blog
引入
5.0.0
弃用
-

_restore_wpautop_hook: 这个函数在原wpautop函数被插件或主题修改后将其恢复到默认状态。

如果do_blocks()需要从`the_content`过滤器中移除wpautop(),这将在之后重新添加它。以供后续的`the_content’使用。

function _restore_wpautop_hook( $content ) {
	$current_priority = has_filter( 'the_content', '_restore_wpautop_hook' );

	add_filter( 'the_content', 'wpautop', $current_priority - 1 );
	remove_filter( 'the_content', '_restore_wpautop_hook', $current_priority );

	return $content;
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-07 06:33:36

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: