Child function not overriding parent function / acts opposite
-
Here is what I have in parent functions.php
// Set image sizes upon theme activation if(! function_exists( 'theme_image_setup' )): function theme_image_setup() { // updating thumbnail and image sizes update_option('thumbnail_size_w', 200); update_option('thumbnail_size_h', 150); update_option('medium_size_w', 620); update_option('medium_size_h', ''); update_option('large_size_w', 940); update_option('large_size_h', ''); } endif; add_action( 'switch_theme', 'theme_image_setup' );
and in child
function theme_image_setup() { // updating thumbnail and image sizes update_option( 'thumbnail_size_w', 150, true ); update_option( 'thumbnail_size_h', 150, true ); update_option( 'medium_size_w', 620, true ); update_option( 'medium_size_h', '', true ); update_option( 'large_size_w', '', true ); update_option( 'large_size_h', 500, true ); }
This looks like it will work perfectly, child overriding parent theme. The problem is it is reverse. When I activate parent theme, the settings from child is coming and vice versa. This code updates the media setting under Settings -> Media. What am I doing wrong? Any help is greatly appreciated. Thanks.
- The topic ‘Child function not overriding parent function / acts opposite’ is closed to new replies.