Hi Denver,
That’s not quite how it works.
I typically don’t suggest overwriting functions, as you may run into issues with updates in the future. However, if you need to, the function needs to be wrapped in a function_exists()
wrapper.
If it is, you need include the entire function along with the wrapper, like this:
if ( ! function_exists( 'generate_article_schema' ) ) {
/**
* Figure out which schema tags to apply to the <article> element
* The function determines the itemtype: generate_article_schema( 'BlogPosting' )
* @since 1.3.15
*/
function generate_article_schema( $type = 'CreativeWork' ) {
// Get the itemtype
$itemtype = esc_html( apply_filters( 'generate_article_itemtype', $type ) );
// Print the results
echo "itemtype='http://schema.org/$itemtype' itemscope='itemscope'"; // WPCS: XSS ok, sanitization ok.
}
}
Then make your changes.
generate_clone_sidebar_navigation() doesn’t have a wrapper, as we’re moving away from them completely.
Instead, you would do this:
remove_action( 'wp_footer', 'generate_clone_sidebar_navigation' );
add_action( 'wp_footer', 'tu_clone_sidebar_navigation' );
function tu_clone_sidebar_navigation() {
// Your custom function
}