Child theme remove parent filter in functions

Have a parent/child theme setup. The parent theme has a filter I want to remove. How do I remove these filters in the child theme functions?

/** ——— */
/** 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);

For example using code like this in our child theme functions:

function remove_language_attributes() {
remove_filter(‘language_attributes’, ‘add_opengraph_doctype’);
}
add_filter(‘init’, ‘remove_language_attributes’);

Read more here:: Child theme remove parent filter in functions

Leave a Reply

Your email address will not be published. Required fields are marked *