• Resolved Camilo

    (@camilo517)


    I need to add a script that overrides a theme function and declares the function again
    But code snippet gives me an error saying “Can’t redeclare function”
    Any way to disable this validation?

Viewing 1 replies (of 1 total)
  • Plugin Author Shea Bunge

    (@bungeshea)

    Yes, you can wrap it in a function_exists() check. Here’s an example:

    if ( ! function_exists( 'twentytwelve_content_nav' ) ) {
    
    	function twentytwelve_content_nav() {
    		echo "it's working!";
    	}
    	
    }
Viewing 1 replies (of 1 total)

The topic ‘Error redeclare’ is closed to new replies.