I have read up on this and tried it myself, but I cannot seem to figure out how to override a parent theme function using my child theme.
I need to know what I am doing wrong (and I am sure there are several wrong things).
Here is the function in the parent theme:
function html5_insert_image($html, $id, $caption, $title, $align, $url, $size, $alt) {
$url = wp_get_attachment_url($id);
$src = wp_get_attachment_image_src( $id, $size, false );
$html5 = "<figure class='align$align'><a href='$url'>";
$html5 .= "<img src='$src[0]' alt='$alt' />";
if ($caption) {
$html5 .= "<figcaption>$caption</figcaption>";
}
$html5 .= "</a></figure>";
return $html5;
}
add_filter( 'image_send_to_editor', 'html5_insert_image', 10, 9 );
Here is the function in the child theme:
function remove_html5_insert_image(){
remove_filter('init','html5_insert_image',1);
}
add_action('after_setup_theme','remove_html5_insert_image');