设置父/子主题。父主题有一个要删除的筛选器。如何在子主题函数中删除这些过滤器?
/** --------- */
/** COMMENTS */
/** --------- */
/** FORMAT COMMENT REPLY FIELD */
add_filter(\'comment_form_field_comment\', function () {
\\XPress::registry()->loadJS(\'themehouse/xpress/comment.js\');
return \'<div data-xf-init="xpress-comment-form">\' . \\XPress::getEditorInstance(\'comment_content\', \'comment\') . \'</div>\';
}, 8);
/** READ XF FROALA EDITOR CONTENT ON SAVE */
add_filter(\'preprocess_comment\', function ($data) {
$data[\'comment_content\'] = \\XPress::getEditorContent(\'comment_content\') ?: $data[\'comment_content\'];
if (empty($data[\'comment_content\']) || $data[\'comment_content\'] === \'x\') {
wp_die(\\XPress::xlink()->phrase(\'xpress_empty_comment_error\'), \\XPress::xlink()->phrase(\'xpress_empty_comment\'));
}
return $data;
}, 99, 1);
例如,在子主题函数中使用如下代码:
function remove_language_attributes() {
remove_filter(\'language_attributes\', \'add_opengraph_doctype\');
}
add_filter(\'init\', \'remove_language_attributes\');