Function in Child Theme not overriding Parent Theme function [duplicate]

First, you are confused. It is not the same “override a function” that remove a filter. Assuming that you want to remove a filter, I think that your code should be:

function remove_html5_insert_image(){
    remove_filter('image_send_to_editor','html5_insert_image', 10);
}
add_action('after_setup_theme','remove_html5_insert_image');

Note that the filter tag and the priority argument in remove_filter must match the filter tag and the priority defined in the filter you want to remove.

Anyway, There is no need of that function since WP 3.9, use this instead to make WordPress use figure and figcaption in the output of captions:

add_action( 'after_setup_theme', 'cyb_theme_setup' );
function tbn_theme_setup() {
    // See more in http://codex.wordpress.org/Function_Reference/add_theme_support#HTML5
    add_theme_support( 'html5', array( 'caption' ) );
}

Leave a Comment