How to remove parent themes function file filter in child themes function file.
function file
function add_opengraph_doctype( $output ) {
return $output. ' prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb#"';
}
add_filter('language_attributes', 'add_opengraph_doctype');
And I have try to remove child theme like as
remove_filter('language_attributes', 'add_opengraph_doctype');
but it’s not working.
A child theme’s
functions.php
file will run before the parent, so it will not be registered yet.You could wait for the
init
action to remove the filter.You can set priority in your filter like this :
and set child them filter priority to grater than 10.